Public report — rhai, published 29 Sep 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_98a0b7b186f941e79211818b48b0a6f2 Filed 29 September 2026, 23:42 UTC Public

Rhaiscript/rhai

Measured 29 September 2026, 23:37 UTC

63% Adequate
CriticalWeakAdequateStrongExemplary

Medium · 72,890 LoC · 3 projects · rebuild ~0.7 person-years · weakest lens: Security (54%)

Findings by grade

49 critical 459 serious 9 minor 42 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 23:37 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

32/37dimensions tool-verifieddeterministic · confidence 1.0 · 5 LLM-assisted, advisory
498findings with an exact file:lineof 517 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
37/119dimensions across the health lenses72890 LoC · 3 projects — wide & deep
Chapters

Executive summary

The system holds an adequate overall standing of 63%, reflecting a workable asset that carries real, compounding risks. While the architecture is robust and performance is strong, the current state creates a fragile foundation for future growth. The business value tied up here is significant, with nearly 73,000 lines of production code and a rebuild cost of approximately €110,000. This is not a trivial utility; it is a core component where changes ripple through the organization, demanding careful stewardship to protect that investment.

The most critical vulnerability lies in security exposure, which scores poorly at 54%. For a system of this size, weak security controls represent a direct threat to operational reliability and customer trust. Remediation here offers the highest protection per euro spent, reducing the likelihood of costly outages or data breaches. Ignoring this gap leaves the business open to external threats that could halt delivery entirely.

Equally damaging is the velocity tax imposed by code quality issues. Average complexity and duplication levels create a hidden drag, costing an estimated 4–8% more effort on every change. This inefficiency compounds annually, consuming roughly 16 to 98 engineer-days each year in wasted effort. This is not just a technical debt; it is a direct hit to product speed and team morale, slowing down feature delivery without adding visible value.

However, the system is not without strengths. The architecture is well-structured, and performance metrics are excellent, indicating that the core logic is sound and efficient. These areas provide a stable base upon which to build improvements. The maturity level is moderate, suggesting that while the code is understandable, onboarding new engineers could be smoother with better documentation.

The highest-leverage action is to record significant decisions in a centralized, discoverable format. This single step pays for itself within months by reducing ambiguity and rework. It addresses the root cause of many downstream issues, including the velocity tax. Focus here first to unlock immediate gains in team efficiency and long-term maintainability, before tackling deeper security or code refactoring tasks.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Security 54% · 46% weightMaturity 65% · 25% weightReadiness 70% · 14% weightCode Health 77% · 8% weightPerformance 90% · 4% weightArchitecture 92% · 2% weight

Raise Security 54 → 70 (the Healthy floor) ⇒ headline 63 → ~70.

Code composition — where the lines go
Tests 100%
New since the last scan (22+)

22 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required.

  • D1 · Op::disassemble (cyclomatic 17) src/grain/bytecode/op.rs
  • D1 · Engine::eval_fn_call_expr (cyclomatic 16) src/func/call.rs
  • D2 · Engine::eval_fn_call_expr (cognitive 30) src/func/call.rs
  • D2 · FnPtr::_call_raw (cognitive 19) src/types/fn_ptr.rs
  • D3 · FileTooLong: func/native.rs src/func/native.rs
  • D4 · Members sharing a duplicated core (4 members, 50+ identical tokens) src/func/native.rs
  • D4 · Duplicated block (12–14 lines × 2) src/grain/vm/mod.rs
  • D4 · Duplicated block (10 lines × 2) src/grain/bytecode/op.rs
  • D4 · Duplicated block (10 lines × 2) src/grain/compile/mod.rs
  • D4 · Duplicated block (5 lines × 2) src/func/native.rs
  • D4 · Duplicated block (7 lines × 2) src/grain/vm/mod.rs
  • D6 · Low cohesion: DynamicSerializer (LCOM4 14) src/serde/ser.rs
  • D6 · Low cohesion: ImmutableString (LCOM4 12) src/types/immutable_string.rs
  • D15 · Hotspot: src/grain/bytecode/op.rs src/grain/bytecode/op.rs
  • D22 · Redundant registration methods for functions with different error handling semantics. `register_fn` and `with_fn` imply standard return types, while `register_result_fn` and `with_result_fn` imply returning `RhaiResult`. This forces users to choose based on implementation detail (whether the function returns a Result or a value) rather than a unified API. Similarly, `register_get`/`with_get` vs `register_get_result`/`with_get_result` duplicates this pattern.
  • D22 · Inconsistent type registration API. `register_type` takes no arguments (likely inferring name), `register_type_with_name` takes a string name, and `register_type_with_name_raw` takes identifiers. Meanwhile, `build_type` returns a builder for complex definitions. The existence of three distinct methods for simple type registration with slight signature variations is confusing.
  • D22 · Excessive duplication of execution methods with nearly identical semantics. `consume`, `eval`, and `run` appear to execute scripts/ASTs. The distinction between them is not immediately obvious from the signatures (e.g., does `consume` store it? does `eval` return a value? does `run` just execute?). Having three verbs for essentially the same action (executing code) creates cognitive load.
  • D22 · Inconsistent naming and grouping for compilation methods. `compile` takes a script string, `compile_file` takes a path, `compile_expression` takes a string but implies a different AST structure. The `_with_scope` variants are repetitive. `compile_into_self_contained` is an outlier in naming convention.
  • D22 · Fragmented function registration on Module. There are specific methods for getters, setters, indexers, and generic functions, plus a `raw` variant. This duplicates the logic found in `Engine` and `TypeBuilder` but with even more variation. `set_fn` vs `set_native_fn` is unclear.
  • D22 · Redundant custom type registration methods on Module. Four methods exist with slight variations in parameters (comments, raw identifiers). This mirrors the inconsistency in `Engine` and `TypeBuilder`.
  • D35 · Change coupling: verify.rs ↔ mod.rs src/grain/bytecode/verify.rs
  • D35 · Change coupling: verify.rs ↔ mod.rs src/grain/bytecode/verify.rs

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €35,000–€180,000
Cost to rebuild€35,000–€180,000 (0.3–1.1 person-years (587–1,862 h), ~1–2 engineers)
Domain complexityStandard — harder problems cost more per line
Quality factor0.9× (at 63% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.7 person-years of build effort (about ~€110,000 to rebuild). Its weakest lens is Security at 54% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.9× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 1 No ADRs found finding(s) in ADR Quality.
+3.7 pts · Low effort · ADR Quality
2
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
+2.3 pts · Low effort · Static Analysis (SAST)
3
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
+2.3 pts · Low effort · Static Analysis (SAST)

Diagnosis — what's actually going on

The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 16.4–98.5 engineer-days every year, paid as drag on the ~178,136 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 4–8% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 43,924 line(s) changed over a 90-day window ⇒ ~178,136/year · D1/D2/D4/D6 code quality: averaging 6.5/10 ⇒ a 4–8% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.7 person-years to rebuild), and its weakest lens is Security at 54%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.7 person-years rebuild (72,890 LoC) · weakest lens: Security 54%
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.5/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 4–8% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.5/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.

arch rhai rhai rhai_codegen rhai_codegen rhai->rhai_codegen

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

273 modules, 388 dependencies. 2 dependency cycles across 35 modules, marked above the diagonal.

Showing the 40 most-connected modules; 233 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 rhai.func.function2 rhai.grain.bytecode.chunk3 rhai.grain.pos4 rhai.types.position5 rhai.types.token6 rhai_codegen.module7 rhai_codegen.ui_tests.export_fn_bad_attr8 rhai.eval.target9 rhai.grain.bytecode.op10 rhai.grain.bytecode.positions11 rhai.types.error12 rhai.types.immutable_string13 rhai.eval.cache14 rhai.eval.debugger15 rhai.types.scope16 rhai.api.definitions17 rhai.eval.global_state18 rhai.func.native19 rhai.func.script20 rhai.optimizer21 rhai.parser22 rhai.engine23 rhai.module.resolvers24 rhai.types.fn_ptr25 rhai.types.dynamic26 rhai.ast.stmt27 rhai.eval.eval_context28 rhai.grain.bytecode.switch29 rhai.ast.ast30 rhai.grain.bytecode.verify31 rhai.ast.expr32 rhai.bin.rhai-dbg33 rhai.grain.format.read34 rhai.module35 rhai.api.custom_syntax36 rhai.grain.program37 rhai.grain.bytecode.chain38 rhai.grain.compile39 rhai.grain.format.write40 rhai.grain.vm
1 rhai.func.function
2 rhai.grain.bytecode.chunk
3 rhai.grain.pos
4 rhai.types.position
5 rhai.types.token
6 rhai_codegen.module
7 rhai_codegen.ui_tests.export_fn_bad_attr
8 rhai.eval.target11
9 rhai.grain.bytecode.op12
10 rhai.grain.bytecode.positions12
11 rhai.types.error11
12 rhai.types.immutable_string1
13 rhai.eval.cache11
14 rhai.eval.debugger2211
15 rhai.types.scope112
16 rhai.api.definitions12
17 rhai.eval.global_state111
18 rhai.func.native211221
19 rhai.func.script2111
20 rhai.optimizer111111111
21 rhai.parser21111
22 rhai.engine11111121112111322221
23 rhai.module.resolvers11111
24 rhai.types.fn_ptr1111111
25 rhai.types.dynamic21
26 rhai.ast.stmt41111
27 rhai.eval.eval_context1122122221
28 rhai.grain.bytecode.switch21
29 rhai.ast.ast11111
30 rhai.grain.bytecode.verify1111
31 rhai.ast.expr221121
32 rhai.bin.rhai-dbg111111
33 rhai.grain.format.read11
34 rhai.module4111211211
35 rhai.api.custom_syntax1111
36 rhai.grain.program222222221122
37 rhai.grain.bytecode.chain3
38 rhai.grain.compile11311412312
39 rhai.grain.format.write11111111
40 rhai.grain.vm13232222322
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
rhai.func.function….grain.bytecode.chunkrhai.grain.posrhai.types.positionrhai.types.tokenrhai_codegen.module…ts.export_fn_bad_attrrhai.eval.targetrhai.grain.bytecode.op…in.bytecode.positionsrhai.types.error…ypes.immutable_stringrhai.eval.cacherhai.eval.debuggerrhai.types.scoperhai.api.definitionsrhai.eval.global_staterhai.func.nativerhai.func.scriptrhai.optimizerrhai.parserrhai.enginerhai.module.resolversrhai.types.fn_ptrrhai.types.dynamicrhai.ast.stmtrhai.eval.eval_context…grain.bytecode.switchrhai.ast.ast…grain.bytecode.verifyrhai.ast.exprrhai.bin.rhai-dbgrhai.grain.format.readrhai.modulerhai.api.custom_syntaxrhai.grain.program….grain.bytecode.chainrhai.grain.compile…ai.grain.format.writerhai.grain.vmrhai.func.function1….grain.bytecode.chunk2rhai.grain.pos3rhai.types.position4rhai.types.token5rhai_codegen.module6…ts.export_fn_bad_attr7rhai.eval.target8rhai.grain.bytecode.op9…in.bytecode.positions10rhai.types.error11…ypes.immutable_string12rhai.eval.cache13rhai.eval.debugger14rhai.types.scope15rhai.api.definitions16rhai.eval.global_state17rhai.func.native18rhai.func.script19rhai.optimizer20rhai.parser21rhai.engine22rhai.module.resolvers23rhai.types.fn_ptr24rhai.types.dynamic25rhai.ast.stmt26rhai.eval.eval_context27…grain.bytecode.switch28rhai.ast.ast29…grain.bytecode.verify30rhai.ast.expr31rhai.bin.rhai-dbg32rhai.grain.format.read33rhai.module34rhai.api.custom_syntax35rhai.grain.program36….grain.bytecode.chain37rhai.grain.compile38…ai.grain.format.write39rhai.grain.vm401112121111122111121211121122121111111111112111111111121112111322221111111111111214111111221222212111111111122112111111111411121121111112222222211223113114123121111111113232222322+233 more modules (most-connected shown)

At a glance — Code Health · 77% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 92% · Adequate · gated by D26 ·

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

At a glance — Readiness · 70% · Strong ·

At a glance — Security · 54% · Adequate · gated by D29, D36 ·

At a glance — Performance · 90% · Exemplary ·

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:2021 — Injection74High / Critical

Roadmap

Begin by establishing a formal architecture decision record to capture key design choices and their consequences, ensuring this documentation is discoverable alongside existing design materials. Simultaneously, address the critical code churn and complexity hotspots, prioritizing the identified files to stabilize the codebase, while resolving the single static analysis security finding in the benchmark configuration. Finally, enhance onboarding by adding a clear build and run quick-start section to the root README.

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

Do thisHelpsEffortDimension
Resolve the 1 No ADRs found finding(s) in ADR Quality.+3.7 ptsLowADR Quality
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+2.3 ptsLowStatic Analysis (SAST)
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+2.3 ptsLowStatic Analysis (SAST)
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).+3.7 ptsMediumArchitecture documentation
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.+3.5 ptsMediumDocumentation (README)
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing.+1.4 ptsLowSupply-chain Provenance & Signing

File quality

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

FileScoreBandWorst signal
REDACTED0.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): High: REDACTED
src/grain/bytecode/verify.rs4.9MixedCyclomatic Complexity: rhai::grain::bytecode::verify::verify_chunk (cyclomatic 29)
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
src/serde/ser.rs5.6MixedGod Classes: ClassTooLong: DynamicSerializer
src/parser.rs6.0MixedExplicit Debt: XxxComment
src/eval/chaining.rs6.0MixedExplicit Debt: XxxComment
src/ast/expr.rs6.0MixedExplicit Debt: XxxComment
codegen/src/custom_type.rs6.0MixedExplicit Debt: TodoComment
src/func/native.rs6.0MixedExplicit Debt: TodoComment
src/func/builtin.rs7.0MixedCyclomatic Complexity: rhai::func::builtin::get_builtin_binary_op_fn (cyclomatic 321)
src/tokenizer.rs7.0MixedCyclomatic Complexity: rhai::tokenizer::get_next_token_inner (cyclomatic 152)
src/grain/vm/mod.rs7.0MixedCyclomatic Complexity: Vm::run_frame (cyclomatic 118)
src/optimizer.rs7.0MixedCyclomatic Complexity: rhai::optimizer::optimize_expr (cyclomatic 115)
src/bin/rhai-dbg.rs7.0MixedCyclomatic Complexity: rhai::bin::rhai-dbg::debug_callback (cyclomatic 68)
src/grain/compile/mod.rs7.0MixedCyclomatic Complexity: Lowering::lower_statement (cyclomatic 62)
src/types/dynamic.rs7.0MixedCyclomatic Complexity: Dynamic::fmt (cyclomatic 45)
src/func/func_call.rs7.0MixedCyclomatic Complexity: Engine::exec_native_fn_call (cyclomatic 33)
src/func/call.rs7.0MixedCyclomatic Complexity: Engine::make_function_call (cyclomatic 32)

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

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

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

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

Could not be resolved — 42

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

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 32 of 37 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

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

What we checked — 37 dimensions across the health lenses
D1D2D3D4D5D6D9D13D15D17D19D20D21D22D26D28D29D34D35D36D44AX10AX3AX4AX8AX9M1M2M3M4P1P10P2P3P4P6PF1

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, 498 of 517 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, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — 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
Watchdog 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
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0ef87-985a-71aa-8063-6dbed86cf269.

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.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: test source is present (.rs) but the built-in coverage collector has no runner for this repository's ecosystem — so this suite was never executed by it. Not scored — this is a gap in the analyzer's language coverage, not a defect in the repo. To have real coverage read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 91 test files), but it was not re-run: the analyzer environment could not run it. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
  • D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 26 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — this repository declares Cargo manifests but commits no Cargo.lock, so the set of crates it actually ships is not resolvable from the checkout: its declarations carry version RANGES, and grading whichever release happens to be newest today would be a verdict about a dependency graph this repository has not pinned. Commit the lock and this dimension grades the closure against crates.io. NOT a finding that this repository's licences are compliant: this dimension asserts nothing about its licensing in either direction.
  • D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (72 contributor(s) across 4983 commit(s) sampled, automation and bot accounts excluded). One of them holds 89% of the history; the other 71 hold 0.2% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXB1 Runtime evidence locked — no reproducible boot — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The Runtime Evidence tier boots an app only via docker-compose, an Aspire AppHost, or a Dockerfile. None was found, so no live runtime a11y/egress/header evidence was collected. You can widen what we reach: add a docker-compose.yml (or an Aspire AppHost) that brings the app up with its dependencies. Watchdog then boots it in an isolated sandbox and gathers real runtime evidence — you change nothing in your pipeline (no CI step, no SDK).
  • C1 Data Protection — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X7 Silent fallback defaults — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C#, Python and TypeScript/JavaScript syntax only, and no C#, Python or TypeScript/JavaScript was loaded for this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

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

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • 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.
  • 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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity3.9 / 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 3.9 / 10 · rule-coverage 100% · ceiling Prevented

73 function(s) exceeded the cyclomatic complexity threshold of 15; the worst was rhai::func::builtin::get_builtin_binary_op_fn at 321. A further 7 function(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 Token::literal_syntax at 80 — they are counted neither in the figure above nor in this dimension's score. 4 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: src/types/token.rs (Token::literal_syntax at 80), src/types/parse_error.rs (ParseErrorType::fmt at 49), src/serde/de.rs (DynamicDeserializer::deserialize_any at 28), src/serde/serialize.rs (Dynamic::serialize at 22). 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.

Engine::eval_stmt (cyclomatic 111) · ×28src/eval/stmt.rs:184
rhai::func::builtin::get_builtin_binary_op_fn (cyclomatic 321) · ×18src/func/builtin.rs:87
Dynamic::fmt (cyclomatic 45) · ×7src/types/dynamic.rs:640
Lowering::lower_statement (cyclomatic 62) · ×4src/grain/compile/mod.rs:992
Expr::fmt (cyclomatic 33) · ×3src/ast/expr.rs:241

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

What to do

  1. Resolve the 28 Engine finding(s) in Cyclomatic Complexity — start with parser.rs (15), call.rs (4), func_call.rs (3). — One of this dimension's main actionable groups (28 warning-level).
  2. Resolve the 18 rhai finding(s) in Cyclomatic Complexity — start with tokenizer.rs (3), optimizer.rs (3), builtin.rs (2). — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 7 Dynamic finding(s) in Cyclomatic Complexity — start with dynamic.rs (7). — One of this dimension's main actionable groups (7 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D2 · Cognitive Complexity3.9 / 10Weak✓ 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 3.9 / 10 · rule-coverage 100% · ceiling Prevented

82 function(s) exceeded the cognitive complexity threshold of 15; the worst was rhai::func::builtin::get_builtin_binary_op_fn at 231.

Engine::eval_stmt (cognitive 206) · ×26src/eval/stmt.rs:184
rhai::func::builtin::get_builtin_binary_op_fn (cognitive 231) · ×21src/func/builtin.rs:87
Dynamic::try_cast_result (cognitive 40) · ×8src/types/dynamic.rs:1500
rhai_codegen::custom_type::scan_fields (cognitive 69) · ×5codegen/src/custom_type.rs:238
Vm::run_frame (cognitive 211) · ×4src/grain/vm/mod.rs:3442

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

What to do

  1. Resolve the 26 Engine finding(s) in Cognitive Complexity — start with parser.rs (12), call.rs (4), func_call.rs (3). — One of this dimension's main actionable groups (26 warning-level).
  2. Resolve the 21 rhai finding(s) in Cognitive Complexity — start with tokenizer.rs (4), optimizer.rs (3), rhai-dbg.rs (3). — One of this dimension's main actionable groups (21 warning-level).
  3. Resolve the 8 Dynamic finding(s) in Cognitive Complexity — start with dynamic.rs (8). — One of this dimension's main actionable groups (8 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D3 · God Classes7.7 / 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.7 / 10 · rule-coverage 100% · ceiling Prevented

63 over-large unit(s) detected — types, modules or files that carry too much.

FileTooLong: src/parser.rs · ×21src/parser.rs
MethodTooLong: Vm.run_frame · ×18src/grain/vm/mod.rs:3442
FunctionTooLong: rhai::func::builtin::get_builtin_binary_op_fn · ×10src/func/builtin.rs:87
TooManyMethods: Engine · ×8src/engine.rs:95
ClassTooLong: Vm · ×5src/grain/vm/mod.rs:309

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

What to do

  1. Resolve the 21 FileTooLong finding(s) in God Classes — start with mod.rs (3), stmt.rs (2), parser.rs. — One of this dimension's main actionable groups (21 warning-level).
  2. Resolve the 18 MethodTooLong finding(s) in God Classes — start with mod.rs (5), call.rs (3), func_call.rs (2). — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 10 FunctionTooLong finding(s) in God Classes — start with optimizer.rs (3), builtin.rs (2), code.rs (2). — One of this dimension's main actionable groups (10 warning-level).
  4. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D4 · Code Duplication8.9 / 10Strong✓ Tool-verified

What it measures: Copy-pasted code that should be shared instead.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.

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

159 duplicated block group(s) detected. A further 8 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 9 of the 167 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.

Duplicated block (7 lines × 2) · ×14codegen/src/lib.rs:243
Duplicated block (10 lines × 2) · ×11src/func/func_call.rs:293
Duplicated block (9 lines × 2) · ×11src/optimizer.rs:477
Duplicated block (11 lines × 2) · ×10src/ast/stmt.rs:575
Duplicated block (5 lines × 2) · ×10src/ast/ast.rs:498

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

What to do

  1. Resolve the 14 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with array_basic.rs (4), mod.rs (2), parser.rs (2). — One of this dimension's main actionable groups (14 warning-level).
  2. Resolve the 11 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with mod.rs (3), func_call.rs (2), ser.rs (2). — One of this dimension's main actionable groups (11 warning-level).
  3. Resolve the 11 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with parser.rs (3), rhai-dbg.rs (2), optimizer.rs. — One of this dimension's main actionable groups (11 warning-level).
  4. Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D5 · Coupling10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)9.4 / 10Stronggated by 2 serious findings✓ 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 9.4 / 10 · rule-coverage 100% · ceiling Verified

2 of 43 classes have LCOM4 above 3.

Low cohesion: DynamicSerializer (LCOM4 14) · ×2src/serde/ser.rs:16

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with ser.rs, immutable_string.rs. — One of this dimension's main actionable groups (2 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

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

D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

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

612 test methods: 200 unit, 412 integration, 0 BDD, 0 e2e. The Rust suite contributes 612 `#[test]` function(s) across 91 file(s) declaring at least one; its unit/integration split is Cargo's own — 73 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.

✓ On the Gold path — maintain.

Detailed fixes: d9_recommendation.md.

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.

D15 · Churn × Complexity Hotspots7.4 / 10Strong✓ 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 7.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/grain/vm/mod.rs (56×118=6608); src/grain/compile/mod.rs (42×62=2604); src/eval/stmt.rs (9×111=999)

Hotspot: src/grain/vm/mod.rs · ×17src/grain/vm/mod.rs:3442

What to do

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

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

D17 · Explicit Debt10.0 / 10Stronggated by 18 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

18 deducted task-comment markers across 72890 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

XxxComment · ×11src/parser.rs:2028
TodoComment · ×7codegen/src/custom_type.rs:208

What to do

  1. Resolve the 11 XxxComment finding(s) in Explicit Debt — start with chaining.rs (7), parser.rs (3), expr.rs. — One of this dimension's main actionable groups (11 warning-level).
  2. Resolve the 7 TodoComment finding(s) in Explicit Debt — start with custom_type.rs (2), native.rs (2), lib.rs. — One of this dimension's main actionable groups (7 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

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

D19 · Documentation QualityExemplary◐ Sampled · advisory

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

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

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

Rhai's documentation is clear and complete for the repository root (an overview + install/usage of rhai-rs crates.io package), but each README documents only its own directory rather than the project as a whole. The root README gives an overview plus installation instructions; every subdirectory README is self-contained, covering what it contains with no cross-directory linkage.

✓ 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: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.

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

No architecture decision records were found.

No ADRs found

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality. — 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.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

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

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D22 · Internal API ConsistencyWeak◐ Sampled · advisory

What it measures: Whether the internal API surface is consistent and coherent.

Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.

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

6 API inconsistencies across 38 exposed types.

Redundant registration methods for functions with different error handling semantics. `register_fn` and `with_fn` imply standard return types, while `register_result_fn` and `with_result_fn` imply returning `RhaiResult`. This forces users to choose based on implementation detail (whether the function returns a Result or a value) rather than a unified API. Similarly, `register_get`/`with_get` vs `register_get_result`/`with_get_result` duplicates this pattern.
Inconsistent type registration API. `register_type` takes no arguments (likely inferring name), `register_type_with_name` takes a string name, and `register_type_with_name_raw` takes identifiers. Meanwhile, `build_type` returns a builder for complex definitions. The existence of three distinct methods for simple type registration with slight signature variations is confusing.
Excessive duplication of execution methods with nearly identical semantics. `consume`, `eval`, and `run` appear to execute scripts/ASTs. The distinction between them is not immediately obvious from the signatures (e.g., does `consume` store it? does `eval` return a value? does `run` just execute?). Having three verbs for essentially the same action (executing code) creates cognitive load.
Inconsistent naming and grouping for compilation methods. `compile` takes a script string, `compile_file` takes a path, `compile_expression` takes a string but implies a different AST structure. The `_with_scope` variants are repetitive. `compile_into_self_contained` is an outlier in naming convention.
Fragmented function registration on Module. There are specific methods for getters, setters, indexers, and generic functions, plus a `raw` variant. This duplicates the logic found in `Engine` and `TypeBuilder` but with even more variation. `set_fn` vs `set_native_fn` is unclear.

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

What to do

  1. Resolve the 1 Redundant registration methods for functions with different error… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 Inconsistent type registration API. `register_type` takes no arguments… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Excessive duplication of execution methods with nearly identical… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).

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

D26 · Project Cohesion3.3 / 10Weak✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

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

1 of 3 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

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

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)1.6 / 10Critical✓ 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 1.6 / 10 · rule-coverage 100% · ceiling Documented

74 finding(s): 0 critical, 49 high, 25 medium, 0 low. 46 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 5 file(s) — `codegen/src/rhai_module.rs` (line 67), `src/func/call.rs` (line 320, line 323, line 324, …), `src/packages/lang_core.rs` (line 212), `src/parser.rs` (line 339), `src/tokenizer.rs` (line 367, line 493, line 730, …) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  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).
  3. No action in Static Analysis (SAST) — all 46 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (46 issue-level, 0 of them charged here).

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

D34 · Knowledge Freshness9.8 / 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 9.8 / 10 · rule-coverage 100% · ceiling Documented

2 of 119 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is fuzz/fuzz_targets/scripting.rs. Counted over 119 of the 206 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned files with no living knowledge

✓ On the Gold path — maintain.

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

D35 · Change Coupling9.8 / 10Stronggated by 2 serious findings✓ 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 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: verify.rs↔mod.rs 62%; verify.rs↔mod.rs 54%

Change coupling: verify.rs ↔ mod.rs · ×2src/grain/bytecode/verify.rs

What to do

  1. Resolve the 2 Change coupling finding(s) in Change Coupling — start with verify.rs (2). — One of this dimension's main actionable groups (2 warning-level).

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

D36 · Supply-chain Provenance & Signing0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

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 composition9.0 / 10Strong✓ 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.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.

AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.

Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. 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.

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

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

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

What to do

  • Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
  • Add a README to the 1 of 3 project(s) that lack one — worth up to 0.7 pts.
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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

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

M4 · Documentation accuracy10.0 / 10Exemplary◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

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 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 · Observability5.5 / 10Adequate✓ 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.

  • Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `codegen`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling6.0 / 10Adequate✓ 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.

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ 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.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene10.0 / 10Exemplary✓ 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.

PF1 · Benchmark discipline9.0 / 10Exemplary✓ Tool-verified

Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.

Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.

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 Health77%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture92%Adequate — gated by D26Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity65%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness70%StrongSolid.
Security54%Adequate — gated by D29, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance90%ExemplaryStrongest area.
Not evidenced — 4 control(s) we could not find positive evidence for

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

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 78 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.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written.
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB1 Runtime evidence locked — no reproducible boot — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D10 Test Quality — ~20303 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
  • D12 Dependency Hygiene — Not scored — 26 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D14 License Compliance — Crate licences not graded — this Cargo repository commits no Cargo.lock
  • D16 Bus Factor — single-maintainer repository — bus factor is not applicable
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D27 Navigability — symbol resolution incomplete — navigability not assessed
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • 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.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not included — suite not readable by the collector
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (20 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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the Rust source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
  • PF3 Async & latency hygiene — Not applicable: this repository declares no async functions, so there is no asynchronous code for a blocking call to stall.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • 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 — 49 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 21 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 459 finding(s)
D1 · Cyclomatic Complexity · Engine · ×28
  • Engine::eval_stmt (cyclomatic 111) src/eval/stmt.rs:184 — Engine::eval_stmt has cyclomatic complexity 111 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Engine::parse_primary (cyclomatic 60) src/parser.rs:1308 — Engine::parse_primary has cyclomatic complexity 60 (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.
  • Engine::eval_dot_index_chain_raw (cyclomatic 48) src/eval/chaining.rs:224 — Engine::eval_dot_index_chain_raw has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Engine::get_indexed_mut (cyclomatic 47) src/eval/indexing.rs:37 — Engine::get_indexed_mut has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Engine::parse_stmt (cyclomatic 43) src/parser.rs:3240 — Engine::parse_stmt has cyclomatic complexity 43 (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.
  • Engine::parse_custom_syntax (cyclomatic 42) src/parser.rs:2440 — Engine::parse_custom_syntax has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Engine::exec_native_fn_call (cyclomatic 33) src/func/func_call.rs:533 — Engine::exec_native_fn_call 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.
  • Engine::make_function_call (cyclomatic 32) src/func/call.rs:423 — Engine::make_function_call has cyclomatic complexity 32 (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.
  • Engine::parse_switch (cyclomatic 32) src/parser.rs:1097 — Engine::parse_switch 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.
  • Engine::parse_binary_op (cyclomatic 32) src/parser.rs:2225 — Engine::parse_binary_op 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.
  • Engine::eval_expr (cyclomatic 30) src/eval/expr.rs:208 — Engine::eval_expr has cyclomatic complexity 30 (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.
  • Engine::make_method_call (cyclomatic 29) src/func/call.rs:61 — Engine::make_method_call has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Engine::parse_postfix (cyclomatic 28) src/parser.rs:1645 — Engine::parse_postfix has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Engine::parse_fn (cyclomatic 25) src/parser.rs:3569 — Engine::parse_fn has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Engine::register_custom_syntax (cyclomatic 24) src/api/custom_syntax.rs:225 — Engine::register_custom_syntax has cyclomatic complexity 24 (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.
  • Engine::make_qualified_function_call (cyclomatic 24) src/func/call.rs:761 — Engine::make_qualified_function_call has cyclomatic complexity 24 (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.
  • Engine::call_script_fn (cyclomatic 23) src/func/script.rs:284 — Engine::call_script_fn 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.
  • Engine::parse_fn_call (cyclomatic 21) src/parser.rs:586 — Engine::parse_fn_call has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Engine::parse_index_chain (cyclomatic 21) src/parser.rs:766 — Engine::parse_index_chain has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (check_argument_types). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
  • Engine::make_dot_expr (cyclomatic 21) src/parser.rs:2071 — Engine::make_dot_expr has cyclomatic complexity 21 (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.
  • Engine::parse_map_literal (cyclomatic 20) src/parser.rs:978 — Engine::parse_map_literal has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Engine::make_assignment_stmt (cyclomatic 20) src/parser.rs:1960 — Engine::make_assignment_stmt has cyclomatic complexity 20 (threshold 15). Of this number, 11 points are the body's own statements and 9 belong to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Engine::exec_fn_call (cyclomatic 19) src/func/func_call.rs:791 — Engine::exec_fn_call 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.
  • Engine::resolve_fn (cyclomatic 17) src/func/func_call.rs:357 — Engine::resolve_fn 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.
  • Engine::eval_fn_call_expr (cyclomatic 16) src/func/call.rs:1015 — Engine::eval_fn_call_expr 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.
  • + 3 more in this group — see findings.md.
D2 · Cognitive Complexity · Engine · ×26
  • Engine::eval_stmt (cognitive 206) src/eval/stmt.rs:184 — Engine::eval_stmt has cognitive complexity 206 (threshold 15). Drivers by points: if/else 50 (118 pts), match/switch 20 (55 pts), loops 9 (25 pts), boolean chains 8 (nesting depth added 119). 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.
  • Engine::eval_dot_index_chain_raw (cognitive 99) src/eval/chaining.rs:224 — Engine::eval_dot_index_chain_raw has cognitive complexity 99 (threshold 15). Drivers by points: if/else 21 (52 pts), match/switch 18 (45 pts), boolean chains 2 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::get_indexed_mut (cognitive 91) src/eval/indexing.rs:37 — Engine::get_indexed_mut has cognitive complexity 91 (threshold 15). Drivers by points: if/else 38 (77 pts), boolean chains 9, match/switch 3 (5 pts) (nesting depth added 41). 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.
  • Engine::parse_primary (cognitive 61) src/parser.rs:1308 — Engine::parse_primary has cognitive complexity 61 (threshold 15). Drivers by points: match/switch 14 (32 pts), if/else 9 (22 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 32). 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.
  • Engine::parse_switch (cognitive 60) src/parser.rs:1097 — Engine::parse_switch has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (37 pts), match/switch 6 (16 pts), loops 3 (7 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::make_method_call (cognitive 59) src/func/call.rs:61 — Engine::make_method_call has cognitive complexity 59 (threshold 15). Drivers by points: if/else 15 (44 pts), match/switch 5 (12 pts), boolean chains 3 (nesting depth added 36). 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.
  • Engine::parse_binary_op (cognitive 58) src/parser.rs:2225 — Engine::parse_binary_op has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (45 pts), match/switch 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::exec_native_fn_call (cognitive 55) src/func/func_call.rs:533 — Engine::exec_native_fn_call has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 6 (16 pts), boolean chains 4 (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.
  • Engine::parse_custom_syntax (cognitive 50) src/parser.rs:2440 — Engine::parse_custom_syntax has cognitive complexity 50 (threshold 15). Drivers by points: match/switch 13 (37 pts), if/else 4 (8 pts), boolean chains 4, loops 1 (nesting depth added 28). 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.
  • Engine::parse_stmt (cognitive 49) src/parser.rs:3240 — Engine::parse_stmt has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (31 pts), match/switch 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::exec_fn_call (cognitive 45) src/func/func_call.rs:791 — Engine::exec_fn_call has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 4 (13 pts), boolean chains 2 (nesting depth added 25). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Engine::make_function_call (cognitive 43) src/func/call.rs:423 — Engine::make_function_call has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 7 (16 pts), match/switch 4 (6 pts), boolean chains 5 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::resolve_fn (cognitive 42) src/func/func_call.rs:357 — Engine::resolve_fn has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (31 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 24). 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.
  • Engine::eval_expr (cognitive 36) src/eval/expr.rs:208 — Engine::eval_expr has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 6 (12 pts), match/switch 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.
  • Engine::parse_fn_call (cognitive 34) src/parser.rs:586 — Engine::parse_fn_call has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (5 pts), boolean chains 3, 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.
  • Engine::parse_postfix (cognitive 32) src/parser.rs:1645 — Engine::parse_postfix has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 8 (20 pts), if/else 5 (9 pts), boolean chains 2, loops 1 (nesting depth added 16). 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.
  • Engine::make_qualified_function_call (cognitive 31) src/func/call.rs:761 — Engine::make_qualified_function_call has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 4 (8 pts), boolean chains 4, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::call_script_fn (cognitive 31) src/func/script.rs:284 — Engine::call_script_fn has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 6 (12 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::eval_fn_call_expr (cognitive 30) src/func/call.rs:1015 — Engine::eval_fn_call_expr has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 3 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • Engine::register_custom_syntax (cognitive 22) src/api/custom_syntax.rs:225 — Engine::register_custom_syntax has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 9, if/else 4 (9 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Engine::make_dot_expr (cognitive 21) src/parser.rs:2071 — Engine::make_dot_expr has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Engine::parse_let (cognitive 21) src/parser.rs:2910 — Engine::parse_let has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11, match/switch 4 (8 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • Engine::parse_fn (cognitive 20) src/parser.rs:3569 — Engine::parse_fn has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 8 (13 pts), if/else 2 (5 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Engine::search_namespace (cognitive 19) src/eval/expr.rs:138 — Engine::search_namespace has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Engine::parse_anon_fn (cognitive 18) src/parser.rs:3777 — Engine::parse_anon_fn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • + 1 more in this group — see findings.md.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D2 · Cognitive Complexity · rhai · ×21
  • rhai::func::builtin::get_builtin_binary_op_fn (cognitive 231) src/func/builtin.rs:87 — rhai::func::builtin::get_builtin_binary_op_fn has cognitive complexity 231 (threshold 15). Drivers by points: if/else 82 (174 pts), match/switch 34 (50 pts), boolean chains 7 (nesting depth added 108). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::tokenizer::get_next_token_inner (cognitive 168) src/tokenizer.rs:829 — rhai::tokenizer::get_next_token_inner has cognitive complexity 168 (threshold 15). Drivers by points: if/else 37 (106 pts), match/switch 15 (50 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 108). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::optimizer::optimize_stmt (cognitive 119) src/optimizer.rs:398 — rhai::optimizer::optimize_stmt has cognitive complexity 119 (threshold 15). Drivers by points: if/else 32 (74 pts), match/switch 14 (27 pts), loops 3 (10 pts), boolean chains 8 (nesting depth added 62). Of this number, 117 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
  • rhai::optimizer::optimize_expr (cognitive 118) src/optimizer.rs:934 — rhai::optimizer::optimize_expr has cognitive complexity 118 (threshold 15). Drivers by points: if/else 26 (62 pts), match/switch 12 (28 pts), boolean chains 20, loops 4 (8 pts) (nesting depth added 56). 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.
  • rhai::bin::rhai-dbg::debug_callback (cognitive 98) src/bin/rhai-dbg.rs:230 — rhai::bin::rhai-dbg::debug_callback has cognitive complexity 98 (threshold 15). Drivers by points: if/else 23 (62 pts), match/switch 8 (25 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::bin::rhai-repl::main (cognitive 86) src/bin/rhai-repl.rs:292 — rhai::bin::rhai-repl::main has cognitive complexity 86 (threshold 15). Drivers by points: if/else 16 (46 pts), match/switch 7 (21 pts), loops 6 (18 pts), boolean chains 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::api::formatting::map_std_type_name (cognitive 76) src/api/formatting.rs:15 — rhai::api::formatting::map_std_type_name has cognitive complexity 76 (threshold 15). Drivers by points: if/else 50 (66 pts), boolean chains 9, match/switch 1 (nesting depth added 16). 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.
  • rhai::optimizer::optimize_stmt_block (cognitive 70) src/optimizer.rs:152 — rhai::optimizer::optimize_stmt_block has cognitive complexity 70 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 5 (15 pts), boolean chains 11, loops 5 (10 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::grain::bytecode::code::assemble (cognitive 60) src/grain/bytecode/code.rs:373 — rhai::grain::bytecode::code::assemble has cognitive complexity 60 (threshold 15). Drivers by points: if/else 21 (47 pts), match/switch 4 (11 pts), loops 2 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::tokenizer::parse_string_literal (cognitive 55) src/tokenizer.rs:492 — rhai::tokenizer::parse_string_literal has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (34 pts), match/switch 4 (10 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::grain::bytecode::verify::verify_chunk (cognitive 41) src/grain/bytecode/verify.rs:250 — rhai::grain::bytecode::verify::verify_chunk has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 4 (8 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::func::builtin::get_builtin_op_assignment_fn (cognitive 41) src/func/builtin.rs:699 — rhai::func::builtin::get_builtin_op_assignment_fn has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 16 (21 pts), if/else 9 (19 pts), boolean chains 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rhai::grain::format::write::put_constant (cognitive 24) src/grain/format/write.rs:358 — rhai::grain::format::write::put_constant has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rhai::tokenizer::scan_block_comment (cognitive 21) src/tokenizer.rs:729 — rhai::tokenizer::scan_block_comment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::tokenizer::parse_raw_string_literal (cognitive 19) src/tokenizer.rs:366 — rhai::tokenizer::parse_raw_string_literal has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::bin::rhai-dbg::print_source (cognitive 18) src/bin/rhai-dbg.rs:13 — rhai::bin::rhai-dbg::print_source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai::packages::array_basic::array_functions::sort_with_builtin_desc (cognitive 18) src/packages/array_basic.rs:1732 — rhai::packages::array_basic::array_functions::sort_with_builtin_desc has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, match/switch 6 (9 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rhai::packages::string_more::string_functions::sub_string (cognitive 17) src/packages/string_more.rs:922 — rhai::packages::string_more::string_functions::sub_string has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
  • rhai::packages::string_more::string_functions::crop (cognitive 17) src/packages/string_more.rs:1073 — rhai::packages::string_more::string_functions::crop 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.
  • rhai::bin::rhai-dbg::load_script (cognitive 16) src/bin/rhai-dbg.rs:164 — rhai::bin::rhai-dbg::load_script has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 5 (7 pts) (nesting depth added 7). 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.
  • rhai::grain::format::read::read (cognitive 16) src/grain/format/read.rs:115 — rhai::grain::format::read::read has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (8 pts), if/else 6, match/switch 1 (2 pts) (nesting depth added 2). 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.
D3 · God Classes · FileTooLong · ×21
  • FileTooLong: src/parser.rs src/parser.rs — FileTooLong — 2580 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 2080 over it, 5.16× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: vm/mod.rs src/grain/vm/mod.rs — FileTooLong — 2523 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 94% of them inside a single declaration: Vm (2 blocks, 309-4468). The bar is 500 significant lines; this is 2023 over it, 5.05× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: types/dynamic.rs src/types/dynamic.rs — FileTooLong — 1606 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: Dynamic (28 blocks, 184-3068). The bar is 500 significant lines; this is 1106 over it, 3.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: module/mod.rs src/module/mod.rs — FileTooLong — 1342 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: Module (9 blocks, 635-2731). The bar is 500 significant lines; this is 842 over it, 2.68× 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: compile/mod.rs src/grain/compile/mod.rs — FileTooLong — 1317 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: Lowering (2 blocks, 288-2421). The bar is 500 significant lines; this is 817 over it, 2.63× 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/tokenizer.rs src/tokenizer.rs — FileTooLong — 1157 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 657 over it, 2.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/optimizer.rs src/optimizer.rs — FileTooLong — 965 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 465 over it, 1.93× 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: func/builtin.rs src/func/builtin.rs — FileTooLong — 829 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 329 over it, 1.66× 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: types/token.rs src/types/token.rs — FileTooLong — 746 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 246 over it, 1.49× 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: packages/array_basic.rs src/packages/array_basic.rs — FileTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 61 free functions. The bar is 500 significant lines; this is 225 over it, 1.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: func/call.rs src/func/call.rs — FileTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: Engine (24-1135). The bar is 500 significant lines; this is 210 over it, 1.42× 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: bytecode/code.rs src/grain/bytecode/code.rs — FileTooLong — 708 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 208 over it, 1.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: packages/string_more.rs src/packages/string_more.rs — FileTooLong — 702 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 59 free functions. The bar is 500 significant lines; this is 202 over it, 1.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: eval/stmt.rs src/eval/stmt.rs — FileTooLong — 586 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: Engine (13-983). The bar is 500 significant lines; this is 86 over it, 1.17× 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: packages/logic.rs src/packages/logic.rs — FileTooLong — 575 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 75 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: ast/stmt.rs src/ast/stmt.rs — FileTooLong — 573 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 73 over it, 1.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: func/func_call.rs src/func/func_call.rs — FileTooLong — 538 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: Engine (242-926). The bar is 500 significant lines; this is 38 over it, 1.08× 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: eval/chaining.rs src/eval/chaining.rs — FileTooLong — 534 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: Engine (35-817). The bar is 500 significant lines; this is 34 over it, 1.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: api/deprecated.rs src/api/deprecated.rs — FileTooLong — 521 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 21 over it, 1.04× 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: ast/expr.rs src/ast/expr.rs — FileTooLong — 517 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 17 over it, 1.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: func/native.rs src/func/native.rs — FileTooLong — 502 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 2 over it, 1.00× 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.
D1 · Cyclomatic Complexity · rhai · ×18
  • rhai::func::builtin::get_builtin_binary_op_fn (cyclomatic 321) src/func/builtin.rs:87 — rhai::func::builtin::get_builtin_binary_op_fn has cyclomatic complexity 321 (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.
  • rhai::tokenizer::get_next_token_inner (cyclomatic 152) src/tokenizer.rs:829 — rhai::tokenizer::get_next_token_inner has cyclomatic complexity 152 (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.
  • rhai::optimizer::optimize_expr (cyclomatic 115) src/optimizer.rs:934 — rhai::optimizer::optimize_expr has cyclomatic complexity 115 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rhai::func::builtin::get_builtin_op_assignment_fn (cyclomatic 111) src/func/builtin.rs:699 — rhai::func::builtin::get_builtin_op_assignment_fn has cyclomatic complexity 111 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rhai::optimizer::optimize_stmt (cyclomatic 80) src/optimizer.rs:398 — rhai::optimizer::optimize_stmt has cyclomatic complexity 80 (threshold 15). Of this number, 77 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::grain::bytecode::code::assemble (cyclomatic 78) src/grain/bytecode/code.rs:373 — rhai::grain::bytecode::code::assemble has cyclomatic complexity 78 (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.
  • rhai::bin::rhai-dbg::debug_callback (cyclomatic 68) src/bin/rhai-dbg.rs:230 — rhai::bin::rhai-dbg::debug_callback has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::api::formatting::map_std_type_name (cyclomatic 46) src/api/formatting.rs:15 — rhai::api::formatting::map_std_type_name has cyclomatic complexity 46 (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.
  • rhai::optimizer::optimize_stmt_block (cyclomatic 44) src/optimizer.rs:152 — rhai::optimizer::optimize_stmt_block has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::tokenizer::parse_string_literal (cyclomatic 44) src/tokenizer.rs:492 — rhai::tokenizer::parse_string_literal has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::bin::rhai-repl::main (cyclomatic 44) src/bin/rhai-repl.rs:292 — rhai::bin::rhai-repl::main has cyclomatic complexity 44 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::grain::bytecode::verify::verify_chunk (cyclomatic 29) src/grain/bytecode/verify.rs:250 — rhai::grain::bytecode::verify::verify_chunk has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • rhai::packages::array_basic::array_functions::sort_with_builtin_desc (cyclomatic 22) src/packages/array_basic.rs:1732 — rhai::packages::array_basic::array_functions::sort_with_builtin_desc has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rhai::grain::format::read::get_constant (cyclomatic 21) src/grain/format/read.rs:437 — rhai::grain::format::read::get_constant has cyclomatic complexity 21 (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.
  • rhai::grain::format::write::put_constant (cyclomatic 20) src/grain/format/write.rs:358 — rhai::grain::format::write::put_constant has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
  • rhai::api::formatting::format_param_type_for_display (cyclomatic 19) src/api/formatting.rs:127 — rhai::api::formatting::format_param_type_for_display has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • rhai::grain::bytecode::verify::required_caps (cyclomatic 16) src/grain/bytecode/verify.rs:468 — rhai::grain::bytecode::verify::required_caps has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: rhai::grain::bytecode::verify::effect (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
  • rhai::tokenizer::parse_raw_string_literal (cyclomatic 16) src/tokenizer.rs:366 — rhai::tokenizer::parse_raw_string_literal 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 · MethodTooLong · ×18
  • MethodTooLong: Vm.run_frame src/grain/vm/mod.rs:3442 — MethodTooLong — run_frame runs 629 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 529 over it, 6.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.eval_stmt src/eval/stmt.rs:184 — MethodTooLong — eval_stmt runs 465 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 365 over it, 4.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.eval_dot_index_chain_raw src/eval/chaining.rs:224 — MethodTooLong — eval_dot_index_chain_raw runs 387 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 287 over it, 3.87× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Lowering.lower_statement src/grain/compile/mod.rs:992 — MethodTooLong — lower_statement runs 303 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 203 over it, 3.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.get_indexed_mut src/eval/indexing.rs:37 — MethodTooLong — get_indexed_mut runs 243 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 143 over it, 2.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.make_method_call src/func/call.rs:61 — MethodTooLong — make_method_call runs 224 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.make_function_call src/func/call.rs:423 — MethodTooLong — make_function_call runs 214 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 114 over it, 2.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.call_script_fn src/func/script.rs:284 — MethodTooLong — call_script_fn runs 166 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Engine.exec_native_fn_call src/func/func_call.rs:533 — MethodTooLong — exec_native_fn_call runs 160 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 60 over it, 1.60× 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: Vm.walk_chain src/grain/vm/mod.rs:1233 — MethodTooLong — walk_chain runs 148 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 48 over it, 1.48× 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: Engine.eval_expr src/eval/expr.rs:208 — MethodTooLong — eval_expr runs 143 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 43 over it, 1.43× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dynamic.fmt src/types/dynamic.rs:640 — MethodTooLong — fmt 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: Engine.make_qualified_function_call src/func/call.rs:761 — MethodTooLong — make_qualified_function_call runs 128 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 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Lowering.switch src/grain/compile/mod.rs:549 — MethodTooLong — switch runs 128 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 28 over it, 1.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Dynamic.fmt src/types/dynamic.rs:484 — MethodTooLong — fmt 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: Engine.resolve_fn src/func/func_call.rs:357 — MethodTooLong — resolve_fn runs 108 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 8 over it, 1.08× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: EvalAltResult.display src/types/error.rs:134 — MethodTooLong — display 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.
  • MethodTooLong: Lowering.expression src/grain/compile/mod.rs:1578 — MethodTooLong — expression runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D15 · Churn × Complexity Hotspots · Hotspot · ×17
  • Hotspot: src/grain/vm/mod.rs src/grain/vm/mod.rs:3442 — src/grain/vm/mod.rs changed 56 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 118 in Vm::run_frame at line 3442. 14 of those changes were fix/bug commits, and the other 42 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/vm/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: src/grain/compile/mod.rs src/grain/compile/mod.rs:992 — src/grain/compile/mod.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in Lowering::lower_statement at line 992. 12 of those changes were fix/bug commits, and the other 30 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/compile/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: src/eval/stmt.rs src/eval/stmt.rs:184 — src/eval/stmt.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 111 in Engine::eval_stmt at line 184. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/eval/stmt.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: src/grain/bytecode/code.rs src/grain/bytecode/code.rs:373 — src/grain/bytecode/code.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in rhai::grain::bytecode::code::assemble at line 373. 4 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/bytecode/code.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: src/parser.rs src/parser.rs:1308 — src/parser.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in Engine::parse_primary at line 1308. 1 of those changes was a fix/bug commit, and the other 13 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/parser.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: src/optimizer.rs src/optimizer.rs:398 — src/optimizer.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in rhai::optimizer::optimize_stmt at line 398. 2 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/optimizer.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: src/func/call.rs src/func/call.rs:423 — src/func/call.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in Engine::make_function_call at line 423. 3 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/func/call.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: src/grain/bytecode/verify.rs src/grain/bytecode/verify.rs:250 — src/grain/bytecode/verify.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in rhai::grain::bytecode::verify::verify_chunk at line 250. 3 of those changes were fix/bug commits, and the other 14 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/bytecode/verify.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: src/tokenizer.rs src/tokenizer.rs:1697 — src/tokenizer.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in TokenIterator::next at line 1697. 2 of those changes were fix/bug commits, and the other 5 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/tokenizer.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: src/grain/bytecode/op.rs src/grain/bytecode/op.rs:858 — src/grain/bytecode/op.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in Op::disassemble at line 858. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/bytecode/op.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: src/grain/format/read.rs src/grain/format/read.rs:437 — src/grain/format/read.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in rhai::grain::format::read::get_constant at line 437. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/format/read.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: src/grain/format/write.rs src/grain/format/write.rs:358 — src/grain/format/write.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in rhai::grain::format::write::put_constant at line 358. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/grain/format/write.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: src/func/script.rs src/func/script.rs:284 — src/func/script.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in Engine::call_script_fn at line 284. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/func/script.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: src/ast/expr.rs src/ast/expr.rs:359 — src/ast/expr.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in Expr::get_literal_value at line 359. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/ast/expr.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: src/types/error.rs src/types/error.rs:134 — src/types/error.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 60 in EvalAltResult::display at line 134. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/types/error.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: src/ast/stmt.rs src/ast/stmt.rs:700 — src/ast/stmt.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in Stmt::is_pure at line 700. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/ast/stmt.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: src/func/func_call.rs src/func/func_call.rs:791 — src/func/func_call.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in Engine::exec_fn_call at line 791. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-02..2026-09-30, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-02 00:42:56 +08:00' --until='2026-09-30 00:42:56 +08:00' --full-history --no-merges -- src/func/func_call.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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×14
  • Duplicated block (7 lines × 2) codegen/src/lib.rs:243 — codegen/src/lib.rs:243-249 | codegen/src/lib.rs:277-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/api/definitions/mod.rs:404 — src/api/definitions/mod.rs:404-410 | src/api/definitions/mod.rs:418-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/func/function.rs:123 — src/func/function.rs:123-129 | src/func/function.rs:137-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/parser.rs:1527 — src/parser.rs:1527-1533 | src/parser.rs:1602-1608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/types/dynamic.rs:505 — src/types/dynamic.rs:505-511 | src/types/dynamic.rs:673-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/api/eval.rs:124 — src/api/eval.rs:124-130 | src/api/run.rs:58-64 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) src/packages/array_basic.rs:1653 — src/packages/array_basic.rs:1653-1659 | src/packages/array_basic.rs:1756-1762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/packages/array_basic.rs:1661 — src/packages/array_basic.rs:1661-1667 | src/packages/array_basic.rs:1768-1774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/packages/array_basic.rs:1687 — src/packages/array_basic.rs:1687-1693 | src/packages/array_basic.rs:1806-1812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/func/builtin.rs:296 — src/func/builtin.rs:296-302 | src/func/builtin.rs:820-826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/func/builtin.rs:404 — src/func/builtin.rs:404-410 | src/func/builtin.rs:539-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/grain/vm/mod.rs:4097 — src/grain/vm/mod.rs:4097-4110 | src/grain/vm/mod.rs:4126-4132 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/parser.rs:2613 — src/parser.rs:2613-2621 | src/parser.rs:2652-2658 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) src/packages/array_basic.rs:1975 — src/packages/array_basic.rs:1975-1981 | src/packages/array_basic.rs:2122-2128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D17 · Explicit Debt · XxxComment · ×11
  • XxxComment src/parser.rs:2028 — // xxx[???]... = rhs, xxx.prop... = rhs — 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.
  • XxxComment src/parser.rs:2277 — // [xxx..] | (xxx..) | {xxx..} | xxx.., | xxx..; | xxx.. => — 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.
  • XxxComment src/parser.rs:2278 — // [xxx..=] | (xxx..=) | {xxx..=} | xxx..=, | xxx..=; | xxx..= => — 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.
  • XxxComment src/ast/expr.rs:200 — /// xxx `.` method `(` expr `,` ... `)` — 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.
  • XxxComment src/eval/chaining.rs:264 — // xxx[idx].expr... | xxx[idx][expr]... — 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.
  • XxxComment src/eval/chaining.rs:327 — // xxx[rhs] op= new_val — 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.
  • XxxComment src/eval/chaining.rs:395 — // xxx[rhs] — 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.
  • XxxComment src/eval/chaining.rs:463 — // {xxx:map}.id op= ??? — 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.
  • XxxComment src/eval/chaining.rs:493 — // {xxx:map}.id — 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.
  • XxxComment src/eval/chaining.rs:616 — // {xxx:map}.sub_lhs[expr] | {xxx:map}.sub_lhs.expr — 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.
  • XxxComment src/eval/chaining.rs:646 — // {xxx:map}.fn_name(arg_expr_list)[expr] | {xxx:map}.fn_name(arg_expr_list).expr — 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×11
  • Duplicated block (10 lines × 2) src/func/func_call.rs:293 — src/func/func_call.rs:293-302 | src/func/func_call.rs:315-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/grain/bytecode/op.rs:863 — src/grain/bytecode/op.rs:863-872 | src/grain/bytecode/op.rs:875-884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/grain/compile/mod.rs:688 — src/grain/compile/mod.rs:688-697 | src/grain/compile/mod.rs:732-741 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/grain/vm/mod.rs:2466 — src/grain/vm/mod.rs:2466-2475 | src/grain/vm/mod.rs:2488-2497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/grain/vm/mod.rs:2464 — src/grain/vm/mod.rs:2464-2473 | src/grain/vm/mod.rs:2478-2487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/serde/ser.rs:515 — src/serde/ser.rs:515-524 | src/serde/ser.rs:550-559 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/serde/ser.rs:632 — src/serde/ser.rs:632-641 | src/serde/ser.rs:671-680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/packages/string_more.rs:1319 — src/packages/string_more.rs:1319-1328 | src/packages/string_more.rs:1396-1405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/func/builtin.rs:545 — src/func/builtin.rs:545-554 | src/func/builtin.rs:587-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) codegen/src/custom_type.rs:148 — codegen/src/custom_type.rs:148-159 | codegen/src/custom_type.rs:164-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) src/func/func_call.rs:727 — src/func/func_call.rs:727-736 | src/func/func_call.rs:752-761 — both copies are in the same file, so extract the 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 (9 lines × 2) · ×11
  • Duplicated block (9 lines × 2) src/optimizer.rs:477 — src/optimizer.rs:477-485 | src/optimizer.rs:488-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/types/dynamic.rs:570 — src/types/dynamic.rs:570-578 | src/types/dynamic.rs:738-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/func/builtin.rs:70 — src/func/builtin.rs:70-78 | src/types/dynamic.rs:1254-1262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (9 lines × 2) src/parser.rs:802 — src/parser.rs:802-810 | src/parser.rs:842-851 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/ast/expr.rs:303 — src/ast/expr.rs:303-311 | src/ast/expr.rs:316-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/func/func_call.rs:691 — src/func/func_call.rs:691-699 | src/func/func_call.rs:708-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/packages/time_basic.rs:126 — src/packages/time_basic.rs:126-134 | src/packages/time_basic.rs:150-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/bin/rhai-dbg.rs:171 — src/bin/rhai-dbg.rs:171-179 | src/bin/rhai-repl.rs:126-134 — before extracting anything, compare `src/bin/rhai-dbg.rs` and `src/bin/rhai-repl.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) src/bin/rhai-dbg.rs:109 — src/bin/rhai-dbg.rs:109-117 | src/bin/rhai-repl.rs:36-44 — before extracting anything, compare `src/bin/rhai-dbg.rs` and `src/bin/rhai-repl.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (9 lines × 2) src/parser.rs:1105 — src/parser.rs:1105-1113 | src/parser.rs:3107-3115 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) src/parser.rs:792 — src/parser.rs:792-800 | src/parser.rs:832-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D3 · God Classes · FunctionTooLong · ×10
  • FunctionTooLong: rhai::func::builtin::get_builtin_binary_op_fn src/func/builtin.rs:87 — FunctionTooLong — rhai::func::builtin::get_builtin_binary_op_fn runs 454 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 354 over it, 4.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::optimizer::optimize_stmt src/optimizer.rs:398 — FunctionTooLong — rhai::optimizer::optimize_stmt runs 321 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 221 over it, 3.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::func::builtin::get_builtin_op_assignment_fn src/func/builtin.rs:699 — FunctionTooLong — rhai::func::builtin::get_builtin_op_assignment_fn runs 319 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 219 over it, 3.19× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::optimizer::optimize_expr src/optimizer.rs:934 — FunctionTooLong — rhai::optimizer::optimize_expr runs 289 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 189 over it, 2.89× 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: rhai::bin::rhai-dbg::debug_callback src/bin/rhai-dbg.rs:230 — FunctionTooLong — rhai::bin::rhai-dbg::debug_callback runs 284 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 184 over it, 2.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::grain::bytecode::code::assemble src/grain/bytecode/code.rs:373 — FunctionTooLong — rhai::grain::bytecode::code::assemble runs 258 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 158 over it, 2.58× 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: rhai::bin::rhai-repl::main src/bin/rhai-repl.rs:292 — FunctionTooLong — rhai::bin::rhai-repl::main runs 209 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 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::grain::bytecode::code::decode src/grain/bytecode/code.rs:864 — FunctionTooLong — rhai::grain::bytecode::code::decode runs 158 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 58 over it, 1.58× 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: rhai::optimizer::optimize_stmt_block src/optimizer.rs:152 — FunctionTooLong — rhai::optimizer::optimize_stmt_block runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: rhai::grain::bytecode::verify::verify_chunk src/grain/bytecode/verify.rs:250 — FunctionTooLong — rhai::grain::bytecode::verify::verify_chunk 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.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×10
  • Duplicated block (11 lines × 2) src/ast/stmt.rs:575 — src/ast/stmt.rs:575-585 | src/ast/stmt.rs:605-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/eval/target.rs:228 — src/eval/target.rs:228-238 | src/eval/target.rs:266-276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/module/resolvers/collection.rs:160 — src/module/resolvers/collection.rs:160-170 | src/module/resolvers/collection.rs:182-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/parser.rs:2170 — src/parser.rs:2170-2180 | src/parser.rs:2205-2215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/tokenizer.rs:1239 — src/tokenizer.rs:1239-1249 | src/tokenizer.rs:1296-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/types/dynamic.rs:610 — src/types/dynamic.rs:610-620 | src/types/dynamic.rs:777-787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/packages/string_more.rs:941 — src/packages/string_more.rs:941-951 | src/packages/string_more.rs:1092-1102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (11 lines × 2) src/grain/format/mod.rs:387 — src/grain/format/mod.rs:387-397 | src/grain/pos/varint.rs:71-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (11 lines × 2) src/packages/array_basic.rs:164 — src/packages/array_basic.rs:164-174 | src/packages/blob_basic.rs:262-272 — before extracting anything, compare `src/packages/array_basic.rs` and `src/packages/blob_basic.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (11 lines × 2) codegen/ui_tests/rhai_fn_index_getter_return.rs:18 — codegen/ui_tests/rhai_fn_index_getter_return.rs:18-28 | codegen/ui_tests/rhai_fn_setter_return.rs:19-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×10
  • Duplicated block (5 lines × 2) src/ast/ast.rs:498 — src/ast/ast.rs:498-502 | src/ast/ast.rs:592-596 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/func/native.rs:349 — src/func/native.rs:349-353 | src/func/native.rs:421-425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/optimizer.rs:575 — src/optimizer.rs:575-579 | src/optimizer.rs:632-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/optimizer.rs:984 — src/optimizer.rs:984-988 | src/optimizer.rs:1088-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/parser.rs:3591 — src/parser.rs:3591-3595 | src/parser.rs:3608-3612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/packages/array_basic.rs:459 — src/packages/array_basic.rs:459-463 | src/packages/blob_basic.rs:574-578 — before extracting anything, compare `src/packages/array_basic.rs` and `src/packages/blob_basic.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) src/packages/array_basic.rs:530 — src/packages/array_basic.rs:530-534 | src/packages/blob_basic.rs:647-651 — before extracting anything, compare `src/packages/array_basic.rs` and `src/packages/blob_basic.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) src/packages/array_basic.rs:547 — src/packages/array_basic.rs:547-551 | src/packages/blob_basic.rs:666-670 — before extracting anything, compare `src/packages/array_basic.rs` and `src/packages/blob_basic.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (5 lines × 2) src/optimizer.rs:967 — src/optimizer.rs:967-971 | src/optimizer.rs:1015-1019 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (5 lines × 2) src/optimizer.rs:1132 — src/optimizer.rs:1132-1136 | src/optimizer.rs:1141-1145 — both copies are in the same file, so extract the 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 (13 lines × 2) · ×9
  • Duplicated block (13 lines × 2) src/serde/deserialize.rs:101 — src/serde/deserialize.rs:101-113 | src/serde/ser.rs:193-205 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/serde/deserialize.rs:116 — src/serde/deserialize.rs:116-128 | src/serde/ser.rs:209-221 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/serde/deserialize.rs:133 — src/serde/deserialize.rs:133-145 | src/serde/ser.rs:227-239 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/serde/ser.rs:616 — src/serde/ser.rs:616-628 | src/serde/ser.rs:655-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/func/builtin.rs:59 — src/func/builtin.rs:59-71 | src/types/dynamic.rs:1232-1244 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (13 lines × 2) src/packages/array_basic.rs:221 — src/packages/array_basic.rs:221-233 | src/packages/blob_basic.rs:329-341 — before extracting anything, compare `src/packages/array_basic.rs` and `src/packages/blob_basic.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (13 lines × 2) src/api/deprecated.rs:972 — src/api/deprecated.rs:972-984 | src/api/deprecated.rs:1043-1055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/packages/array_basic.rs:1695 — src/packages/array_basic.rs:1695-1707 | src/packages/array_basic.rs:1818-1830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (13 lines × 2) src/func/builtin.rs:275 — src/func/builtin.rs:275-287 | src/func/builtin.rs:799-811 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · Dynamic · ×8
  • Dynamic::try_cast_result (cognitive 40) src/types/dynamic.rs:1500 — Dynamic::try_cast_result has cognitive complexity 40 (threshold 15). Drivers by points: match/switch 14 (26 pts), if/else 14 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Dynamic::downcast_ref (cognitive 38) src/types/dynamic.rs:1869 — Dynamic::downcast_ref has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 13 (25 pts), if/else 13 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::downcast_mut) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::downcast_mut (cognitive 38) src/types/dynamic.rs:1972 — Dynamic::downcast_mut has cognitive complexity 38 (threshold 15). Drivers by points: match/switch 13 (25 pts), if/else 13 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::downcast_ref) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::fmt (cognitive 33) src/types/dynamic.rs:640 — Dynamic::fmt has cognitive complexity 33 (threshold 15). Drivers by points: if/else 23 (42 pts), loops 3 (9 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::fmt::checked_debug_fmt) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::fmt (cognitive 30) src/types/dynamic.rs:484 — Dynamic::fmt has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (40 pts), match/switch 4 (8 pts), loops 2 (6 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::fmt::display_fmt_print) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::hash (cognitive 21) src/types/dynamic.rs:390 — Dynamic::hash has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 2 (nesting depth added 5). 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.
  • Dynamic::fmt::checked_debug_fmt (cognitive 19) src/types/dynamic.rs:749 — Dynamic::fmt::checked_debug_fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::fmt) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::fmt::display_fmt_print (cognitive 17) src/types/dynamic.rs:581 — Dynamic::fmt::display_fmt_print has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. This shape REPEATS in the file: one other method here (Dynamic::fmt) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D3 · God Classes · TooManyMethods · ×8
  • TooManyMethods: Engine src/engine.rs:95 — TooManyMethods — 224 methods, declared across 32 files: src/parser.rs (32), api/limits.rs (20), api/options.rs (20), api/register.rs (19), +28 more file(s). The bar is 30 methods; this is 194 over it, 7.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Module src/module/mod.rs:635 — TooManyMethods — 91 methods, declared across 3 files: module/mod.rs (83), api/deprecated.rs (6), definitions/mod.rs (2). The bar is 30 methods; this is 61 over it, 3.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Dynamic src/types/dynamic.rs:55 — TooManyMethods — 69 methods, declared across 2 files: types/dynamic.rs (67), api/deprecated.rs (2). The bar is 30 methods; this is 39 over it, 2.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Vm src/grain/vm/mod.rs:309 — TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.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: Lowering src/grain/compile/mod.rs:288 — TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Program src/grain/program.rs:76 — TooManyMethods — 46 methods, declared across 2 files: grain/program.rs (42), format/mod.rs (4). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Scope src/types/scope.rs:62 — TooManyMethods — 36 methods, declared across 2 files: types/scope.rs (35), definitions/mod.rs (1). The bar is 30 methods; this is 6 over it, 1.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: AST src/ast/ast.rs:22 — TooManyMethods — 33 methods, declared across 2 files: ast/ast.rs (31), api/deprecated.rs (2). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D1 · Cyclomatic Complexity · Dynamic · ×7
  • Dynamic::fmt (cyclomatic 45) src/types/dynamic.rs:640 — Dynamic::fmt has cyclomatic complexity 45 (threshold 15). Of this number, 34 points are the body's own statements and 11 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.
  • Dynamic::fmt (cyclomatic 41) src/types/dynamic.rs:484 — Dynamic::fmt has cyclomatic complexity 41 (threshold 15). Of this number, 32 points are the body's own statements and 9 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.
  • Dynamic::hash (cyclomatic 29) src/types/dynamic.rs:390 — Dynamic::hash has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Dynamic::try_cast_result (cyclomatic 29) src/types/dynamic.rs:1500 — Dynamic::try_cast_result has cyclomatic complexity 29 (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.
  • Dynamic::downcast_ref (cyclomatic 28) src/types/dynamic.rs:1869 — Dynamic::downcast_ref has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (Dynamic::downcast_mut) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::downcast_mut (cyclomatic 28) src/types/dynamic.rs:1972 — Dynamic::downcast_mut has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (Dynamic::downcast_ref) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
  • Dynamic::is_hashable (cyclomatic 24) src/types/dynamic.rs:1206 — Dynamic::is_hashable has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D17 · Explicit Debt · TodoComment · ×7
  • TodoComment codegen/src/custom_type.rs:208 — // TODO store (with lazy static) the vec of string — 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 codegen/src/custom_type.rs:209 — // TODO maybe optimization, reverse the order of segments — 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 src/lib.rs:96 — // TODO: Further audit no_std compatibility — 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 src/func/native.rs:34 — // TODO: Further audit no_std compatibility — 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 src/func/native.rs:41 — // TODO: Further audit no_std compatibility — 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 src/packages/arithmetic.rs:536 — // TODO: Remove this limit when `rust-decimal` is updated with the fix. — 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 tests/unary_after_binary.rs:4 — // TODO also add test case for unary after compound — 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.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×7
  • Duplicated block (12 lines × 2) src/serde/ser.rs:500 — src/serde/ser.rs:500-511 | src/serde/ser.rs:535-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/packages/logic.rs:240 — src/packages/logic.rs:240-251 | src/packages/logic.rs:259-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/packages/logic.rs:278 — src/packages/logic.rs:278-289 | src/packages/logic.rs:297-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/packages/logic.rs:516 — src/packages/logic.rs:516-527 | src/packages/logic.rs:535-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/packages/logic.rs:554 — src/packages/logic.rs:554-565 | src/packages/logic.rs:573-584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/bin/rhai-dbg.rs:409 — src/bin/rhai-dbg.rs:409-420 | src/bin/rhai-dbg.rs:432-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (12 lines × 2) src/packages/array_basic.rs:188 — src/packages/array_basic.rs:188-200 | src/packages/map_basic.rs:160-171 — 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.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×6
  • Duplicated block (16 lines × 2) src/module/mod.rs:1996 — src/module/mod.rs:1996-2011 | src/module/mod.rs:2029-2044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/optimizer.rs:1158 — src/optimizer.rs:1158-1173 | src/optimizer.rs:1194-1209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/types/dynamic.rs:592 — src/types/dynamic.rs:592-607 | src/types/dynamic.rs:759-774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) src/bin/rhai-dbg.rs:185 — src/bin/rhai-dbg.rs:185-200 | src/bin/rhai-repl.rs:142-157 — before extracting anything, compare `src/bin/rhai-dbg.rs` and `src/bin/rhai-repl.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (16 lines × 2) src/packages/string_more.rs:957 — src/packages/string_more.rs:957-972 | src/packages/string_more.rs:1110-1125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (16 lines × 2) codegen/ui_tests/rhai_fn_rename_collision_oneattr_multiple.rs:13 — codegen/ui_tests/rhai_fn_rename_collision_oneattr_multiple.rs:13-30 | codegen/ui_tests/rhai_mod_unknown_type.rs:12-27 — 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.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×6
  • Duplicated block (15 lines × 2) src/parser.rs:624 — src/parser.rs:624-638 | src/parser.rs:1829-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/serde/deserialize.rs:152 — src/serde/deserialize.rs:152-166 | src/serde/ser.rs:245-259 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) src/serde/deserialize.rs:170 — src/serde/deserialize.rs:170-184 | src/serde/ser.rs:263-277 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) src/bin/rhai-dbg.rs:88 — src/bin/rhai-dbg.rs:88-102 | src/bin/rhai-repl.rs:15-29 — before extracting anything, compare `src/bin/rhai-dbg.rs` and `src/bin/rhai-repl.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (15 lines × 2) src/packages/bit_field.rs:134 — src/packages/bit_field.rs:134-148 | src/packages/bit_field.rs:230-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (15 lines × 2) src/packages/map_basic.rs:412 — src/packages/map_basic.rs:412-426 | src/packages/map_basic.rs:476-490 — both copies are in the same file, so extract the 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 (8 lines × 2) · ×6
  • Duplicated block (8 lines × 2) src/ast/expr.rs:546 — src/ast/expr.rs:546-553 | src/ast/expr.rs:603-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/parser.rs:2576 — src/parser.rs:2576-2583 | src/parser.rs:2585-2592 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/parser.rs:3657 — src/parser.rs:3657-3664 | src/parser.rs:3825-3832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/types/fn_ptr.rs:278 — src/types/fn_ptr.rs:278-285 | src/types/fn_ptr.rs:318-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2) src/bin/rhai-repl.rs:36 — src/bin/rhai-repl.rs:36-43 | src/bin/rhai-run.rs:19-26 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) src/packages/array_basic.rs:1678 — src/packages/array_basic.rs:1678-1685 | src/packages/array_basic.rs:1793-1800 — both copies are in the same file, so extract the 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 (6 lines × 2) · ×6
  • Duplicated block (6 lines × 2) src/grain/compile/mod.rs:569 — src/grain/compile/mod.rs:569-574 | src/grain/compile/mod.rs:597-602 — both copies are in the same file, so extract the block into 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) src/types/dynamic.rs:1875 — src/types/dynamic.rs:1875-1880 | src/types/dynamic.rs:1978-1983 — both copies are in the same file, so extract the block into 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) src/packages/array_basic.rs:1670 — src/packages/array_basic.rs:1670-1675 | src/packages/array_basic.rs:1781-1786 — both copies are in the same file, so extract the block into 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) src/func/builtin.rs:308 — src/func/builtin.rs:308-313 | src/func/builtin.rs:832-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (6 lines × 2) src/tokenizer.rs:1201 — src/tokenizer.rs:1201-1206 | src/tokenizer.rs:1377-1382 — both copies are in the same file, so extract the block into 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) src/packages/bit_field.rs:106 — src/packages/bit_field.rs:106-111 | src/packages/bit_field.rs:196-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D2 · Cognitive Complexity · rhai_codegen · ×5
  • rhai_codegen::custom_type::scan_fields (cognitive 69) codegen/src/custom_type.rs:238 — rhai_codegen::custom_type::scan_fields has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (42 pts), match/switch 7 (19 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai_codegen::rhai_module::generate_body (cognitive 35) codegen/src/rhai_module.rs:29 — rhai_codegen::rhai_module::generate_body has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 3 (9 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai_codegen::custom_type::derive_custom_type_impl (cognitive 28) codegen/src/custom_type.rs:20 — rhai_codegen::custom_type::derive_custom_type_impl has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 5 (9 pts), loops 3 (5 pts) (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • rhai_codegen::rhai_module::check_rename_collisions (cognitive 22) codegen/src/rhai_module.rs:260 — rhai_codegen::rhai_module::check_rename_collisions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • rhai_codegen::attrs::doc_attributes (cognitive 18) codegen/src/attrs.rs:134 — rhai_codegen::attrs::doc_attributes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · ClassTooLong · ×5
  • ClassTooLong: Vm src/grain/vm/mod.rs:309 — ClassTooLong — 2368 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 59 methods, 2 blocks, lines 309-4468. The bar is 400 significant lines; this is 1968 over it, 5.92× 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: Dynamic src/types/dynamic.rs:55 — ClassTooLong — 1487 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 69 methods, 28 blocks, lines 184-3068. The bar is 400 significant lines; this is 1087 over it, 3.72× 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: Lowering src/grain/compile/mod.rs:288 — ClassTooLong — 1079 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 288-2421. The bar is 400 significant lines; this is 679 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Module src/module/mod.rs:635 — ClassTooLong — 1012 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 91 methods, 9 blocks, lines 635-2731. The bar is 400 significant lines; this is 612 over it, 2.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DynamicSerializer src/serde/ser.rs:16 — ClassTooLong — 422 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 8 blocks, lines 16-681. The bar is 400 significant lines; this is 22 over it, 1.06× 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.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×5
  • Duplicated block (17 lines × 2) src/grain/vm/mod.rs:2749 — src/grain/vm/mod.rs:2749-2769 | src/grain/vm/mod.rs:2825-2841 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/parser.rs:3338 — src/parser.rs:3338-3354 | src/parser.rs:3785-3801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) src/serde/deserialize.rs:66 — src/serde/deserialize.rs:66-82 | src/serde/ser.rs:158-174 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (17 lines × 2) src/eval/data_check.rs:35 — src/eval/data_check.rs:35-51 | src/eval/data_check.rs:77-93 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (17 lines × 2) codegen/ui_tests/first_shared_ref.rs:12 — codegen/ui_tests/first_shared_ref.rs:12-28 | codegen/ui_tests/non_clonable.rs:12-28 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×5
  • Duplicated block (12 lines × 4) src/func/native.rs:325 — src/func/native.rs:325-336 | src/func/native.rs:360-371 | src/func/native.rs:393-404 | src/func/native.rs:432-443 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) src/packages/logic.rs:316 — src/packages/logic.rs:316-327 | src/packages/logic.rs:335-346 | src/packages/logic.rs:392-403 | src/packages/logic.rs:411-422 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) src/packages/logic.rs:354 — src/packages/logic.rs:354-365 | src/packages/logic.rs:373-384 | src/packages/logic.rs:430-441 | src/packages/logic.rs:449-460 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) src/packages/logic.rs:592 — src/packages/logic.rs:592-603 | src/packages/logic.rs:611-622 | src/packages/logic.rs:668-679 | src/packages/logic.rs:687-698 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 4) src/packages/logic.rs:630 — src/packages/logic.rs:630-641 | src/packages/logic.rs:649-660 | src/packages/logic.rs:706-717 | src/packages/logic.rs:725-736 — 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.
D1 · Cyclomatic Complexity · Lowering · ×4
  • Lowering::lower_statement (cyclomatic 62) src/grain/compile/mod.rs:992 — Lowering::lower_statement has cyclomatic complexity 62 (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.
  • Lowering::expression (cyclomatic 36) src/grain/compile/mod.rs:1578 — Lowering::expression has cyclomatic complexity 36 (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.
  • Lowering::switch (cyclomatic 24) src/grain/compile/mod.rs:549 — Lowering::switch has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Lowering::chain (cyclomatic 21) src/grain/compile/mod.rs:387 — Lowering::chain has cyclomatic complexity 21 (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.
D2 · Cognitive Complexity · Vm · ×4
  • Vm::run_frame (cognitive 211) src/grain/vm/mod.rs:3442 — Vm::run_frame has cognitive complexity 211 (threshold 15). Drivers by points: if/else 62 (184 pts), match/switch 5 (15 pts), loops 3 (7 pts), boolean chains 5 (nesting depth added 136). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Vm::call_syntactic (cognitive 27) src/grain/vm/mod.rs:2441 — Vm::call_syntactic has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Vm::walk_chain (cognitive 19) src/grain/vm/mod.rs:1233 — Vm::walk_chain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (6 pts), loops 1 (3 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.
  • Vm::walk_property (cognitive 16) src/grain/vm/mod.rs:1790 — Vm::walk_property has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lowering · ×4
  • Lowering::lower_statement (cognitive 74) src/grain/compile/mod.rs:992 — Lowering::lower_statement has cognitive complexity 74 (threshold 15). Drivers by points: if/else 24 (43 pts), match/switch 11 (21 pts), loops 3 (8 pts), boolean chains 2 (nesting depth added 34). 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.
  • Lowering::switch (cognitive 34) src/grain/compile/mod.rs:549 — Lowering::switch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 8 (11 pts), match/switch 4 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Lowering::chain (cognitive 26) src/grain/compile/mod.rs:387 — Lowering::chain has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (8 pts), loops 2 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Lowering::expression (cognitive 24) src/grain/compile/mod.rs:1578 — Lowering::expression has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Module · ×4
  • Module::eval_ast_as_new_raw (cognitive 28) src/module/mod.rs:2339 — Module::eval_ast_as_new_raw has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Module::parse (cognitive 23) codegen/src/module.rs:130 — Module::parse has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 4 (8 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Module::build_index::index_module (cognitive 22) src/module/mod.rs:2489 — Module::build_index::index_module has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4, match/switch 2 (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.
  • Module::write_definition (cognitive 16) src/api/definitions/mod.rs:400 — Module::write_definition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3, match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×4
  • Members sharing a duplicated core (4 members, 50+ identical tokens) src/func/native.rs:314 — src/func/native.rs:314-336 | src/func/native.rs:348-371 | src/func/native.rs:382-404 | src/func/native.rs:420-443 — 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) src/module/mod.rs:1993 — src/module/mod.rs:1993-2018 | src/module/mod.rs:2024-2051 | src/module/mod.rs:2056-2098 | src/module/mod.rs:2111-2153 — 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) src/serde/deserialize.rs:115 — src/serde/deserialize.rs:115-130 | src/serde/deserialize.rs:132-147 | src/serde/ser.rs:208-223 | src/serde/ser.rs:226-241 — 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) src/packages/math_basic.rs:463 — src/packages/math_basic.rs:463-476 | src/packages/math_basic.rs:480-493 | src/packages/math_basic.rs:497-510 | src/packages/math_basic.rs:514-527 — 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 · Duplicated block (11 lines × 6) · ×4
  • Duplicated block (11 lines × 6) src/packages/logic.rs:238 — src/packages/logic.rs:238-248 | src/packages/logic.rs:257-267 | src/packages/logic.rs:352-362 | src/packages/logic.rs:371-381 | src/packages/logic.rs:428-438 | src/packages/logic.rs:447-457 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 6) src/packages/logic.rs:276 — src/packages/logic.rs:276-286 | src/packages/logic.rs:295-305 | src/packages/logic.rs:314-324 | src/packages/logic.rs:333-343 | src/packages/logic.rs:390-400 | src/packages/logic.rs:409-419 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 6) src/packages/logic.rs:514 — src/packages/logic.rs:514-524 | src/packages/logic.rs:533-543 | src/packages/logic.rs:628-638 | src/packages/logic.rs:647-657 | src/packages/logic.rs:704-714 | src/packages/logic.rs:723-733 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (11 lines × 6) src/packages/logic.rs:552 — src/packages/logic.rs:552-562 | src/packages/logic.rs:571-581 | src/packages/logic.rs:590-600 | src/packages/logic.rs:609-619 | src/packages/logic.rs:666-676 | src/packages/logic.rs:685-695 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D1 · Cyclomatic Complexity · Expr · ×3
  • Expr::fmt (cyclomatic 33) src/ast/expr.rs:241 — Expr::fmt has cyclomatic complexity 33 (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.
  • Expr::get_literal_value (cyclomatic 26) src/ast/expr.rs:359 — Expr::get_literal_value has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
  • Expr::walk (cyclomatic 23) src/ast/expr.rs:737 — Expr::walk 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.
D1 · Cyclomatic Complexity · rhai_codegen · ×3
  • rhai_codegen::custom_type::scan_fields (cyclomatic 31) codegen/src/custom_type.rs:238 — rhai_codegen::custom_type::scan_fields 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.
  • rhai_codegen::rhai_module::generate_body (cyclomatic 19) codegen/src/rhai_module.rs:29 — rhai_codegen::rhai_module::generate_body 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.
  • rhai_codegen::custom_type::derive_custom_type_impl (cyclomatic 18) codegen/src/custom_type.rs:20 — rhai_codegen::custom_type::derive_custom_type_impl has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D4 · Code Duplication · Duplicated block (12 lines × 3) · ×3
  • Duplicated block (12 lines × 3) src/parser.rs:632 — src/parser.rs:632-643 | src/parser.rs:700-711 | src/parser.rs:1837-1848 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) src/api/eval.rs:209 — src/api/eval.rs:209-220 | src/api/eval.rs:322-333 | src/api/eval.rs:356-367 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (12 lines × 3) src/packages/array_basic.rs:811 — src/packages/array_basic.rs:811-822 | src/packages/array_basic.rs:903-914 | src/packages/array_basic.rs:2267-2278 — 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 (7–8 lines × 2) · ×3
  • Duplicated block (7–8 lines × 2) src/func/func_call.rs:548 — src/func/func_call.rs:548-554 | src/func/func_call.rs:805-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–8 lines × 2) src/packages/string_more.rs:1591 — src/packages/string_more.rs:1591-1597 | src/packages/string_more.rs:1671-1678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7–8 lines × 2) src/func/builtin.rs:599 — src/func/builtin.rs:599-606 | src/func/builtin.rs:610-616 — both copies are in the same file, so extract the 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 · Stmt · ×2
  • Stmt::walk (cyclomatic 50) src/ast/stmt.rs:837 — Stmt::walk 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.
  • Stmt::is_pure (cyclomatic 22) src/ast/stmt.rs:700 — Stmt::is_pure has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D2 · Cognitive Complexity · Expr · ×2
  • Expr::walk (cognitive 36) src/ast/expr.rs:737 — Expr::walk has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (12 pts), match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • Expr::fmt (cognitive 24) src/ast/expr.rs:241 — Expr::fmt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · ExportedFn · ×2
  • ExportedFn::generate_impl (cognitive 29) codegen/src/function.rs:661 — ExportedFn::generate_impl has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 10 (13 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • ExportedFn::parse (cognitive 19) codegen/src/function.rs:281 — ExportedFn::parse has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 3 (4 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · FnPtr · ×2
  • FnPtr::_call_raw (cognitive 19) src/types/fn_ptr.rs:437 — FnPtr::_call_raw has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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.
  • FnPtr::_call_with_extra_args (cognitive 16) src/types/fn_ptr.rs:599 — FnPtr::_call_with_extra_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2, boolean chains 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D35 · Change Coupling · Change coupling · ×2
  • Change coupling: verify.rs ↔ mod.rs src/grain/bytecode/verify.rs — `src/grain/bytecode/verify.rs` and `src/grain/compile/mod.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `858ada21` Leave switch subject on stack and avoid putting it into scope.; `7b0d7ead` Optimize out Unit/Pop pairs, control flow structure jumps (#1156); `68336226` Fix missing caps in verifier. — run `git show` on any of them.
  • Change coupling: verify.rs ↔ mod.rs src/grain/bytecode/verify.rs — `src/grain/bytecode/verify.rs` and `src/grain/vm/mod.rs` change together 54% of the time (7 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `858ada21` Leave switch subject on stack and avoid putting it into scope.; `a0797968` Merge pull request #1148 from rhaiscript/vm-capabilities; `4bc1cfa4` Fix bug with declaring const. — run `git show` on any of them.
D4 · Code Duplication · Members sharing a duplicated core (12 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (12 members, 50+ identical tokens) src/packages/logic.rs:234 — src/packages/logic.rs:234-251 | src/packages/logic.rs:253-270 | src/packages/logic.rs:272-289 | src/packages/logic.rs:291-308 | src/packages/logic.rs:310-327 | src/packages/logic.rs:329-346 | src/packages/logic.rs:348-365 | src/packages/logic.rs:367-384 | src/packages/logic.rs:386-403 | src/packages/logic.rs:405-422 | src/packages/logic.rs:424-441 | src/packages/logic.rs:443-460 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
  • Members sharing a duplicated core (12 members, 50+ identical tokens) src/packages/logic.rs:510 — src/packages/logic.rs:510-527 | src/packages/logic.rs:529-546 | src/packages/logic.rs:548-565 | src/packages/logic.rs:567-584 | src/packages/logic.rs:586-603 | src/packages/logic.rs:605-622 | src/packages/logic.rs:624-641 | src/packages/logic.rs:643-660 | src/packages/logic.rs:662-679 | src/packages/logic.rs:681-698 | src/packages/logic.rs:700-717 | src/packages/logic.rs:719-736 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×2
  • Duplicated block (21 lines × 2) src/serde/deserialize.rs:43 — src/serde/deserialize.rs:43-63 | src/serde/ser.rs:134-154 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
  • Duplicated block (21 lines × 2) src/packages/map_basic.rs:428 — src/packages/map_basic.rs:428-448 | src/packages/map_basic.rs:492-512 — both copies are in the same file, so extract the 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 (20 lines × 2) · ×2
  • Duplicated block (20 lines × 2) src/func/script.rs:115 — src/func/script.rs:115-134 | src/func/script.rs:194-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (20 lines × 2) src/types/dynamic.rs:549 — src/types/dynamic.rs:549-568 | src/types/dynamic.rs:717-736 — both copies are in the same file, so extract the 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 (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) codegen/src/lib.rs:251 — codegen/src/lib.rs:251-264 | codegen/src/lib.rs:285-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (14 lines × 2) src/func/native.rs:654 — src/func/native.rs:654-667 | src/func/native.rs:696-709 — both copies are in the same file, so extract the 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 (9 lines × 6) · ×2
  • Duplicated block (9 lines × 6) src/packages/logic.rs:257 — src/packages/logic.rs:257-265 | src/packages/logic.rs:295-303 | src/packages/logic.rs:333-341 | src/packages/logic.rs:371-379 | src/packages/logic.rs:409-417 | src/packages/logic.rs:447-455 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 6) src/packages/logic.rs:533 — src/packages/logic.rs:533-541 | src/packages/logic.rs:571-579 | src/packages/logic.rs:609-617 | src/packages/logic.rs:647-655 | src/packages/logic.rs:685-693 | src/packages/logic.rs:723-731 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (9 lines × 4) · ×2
  • Duplicated block (9 lines × 4) src/eval/chaining.rs:336 — src/eval/chaining.rs:336-344 | src/eval/chaining.rs:404-412 | src/eval/chaining.rs:474-482 | src/eval/chaining.rs:630-638 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
  • Duplicated block (9 lines × 4) src/serde/deserialize.rs:122 — src/serde/deserialize.rs:122-130 | src/serde/deserialize.rs:139-147 | src/serde/ser.rs:215-223 | src/serde/ser.rs:233-241 — before extracting anything, compare `src/serde/deserialize.rs` and `src/serde/ser.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) src/eval/eval_context.rs:273 — src/eval/eval_context.rs:273-280 | src/eval/eval_context.rs:320-327 | src/types/fn_ptr.rs:293-300 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
  • Duplicated block (8 lines × 3) src/packages/array_basic.rs:1751 — src/packages/array_basic.rs:1751-1758 | src/packages/array_basic.rs:1801-1808 | src/packages/array_basic.rs:1813-1820 — 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.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: DynamicSerializer (LCOM4 14) src/serde/ser.rs:16 — DynamicSerializer's methods fall into 14 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 14 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: ImmutableString (LCOM4 12) src/types/immutable_string.rs:50 — ImmutableString's methods fall into 12 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 12 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · Vm · ×1
  • Vm::run_frame (cyclomatic 118) src/grain/vm/mod.rs:3442 — Vm::run_frame has cyclomatic complexity 118 (threshold 15). To reduce it, separate the cases: extract each independent 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 · EvalAltResult · ×1
  • EvalAltResult::display (cyclomatic 60) src/types/error.rs:134 — EvalAltResult::display has cyclomatic complexity 60 (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 · TokenIterator · ×1
  • TokenIterator::next (cyclomatic 41) src/tokenizer.rs:1697 — TokenIterator::next has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent 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 · ExportedFnParams · ×1
  • ExportedFnParams::from_info (cyclomatic 27) codegen/src/function.rs:123 — ExportedFnParams::from_info has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ExportedFn · ×1
  • ExportedFn::parse (cyclomatic 17) codegen/src/function.rs:281 — ExportedFn::parse has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Debugger · ×1
  • Debugger::is_break_point (cyclomatic 17) src/eval/debugger.rs:322 — Debugger::is_break_point has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · Op · ×1
  • Op::disassemble (cyclomatic 17) src/grain/bytecode/op.rs:858 — Op::disassemble has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · ExportedModParams · ×1
  • ExportedModParams::from_info (cyclomatic 16) codegen/src/module.rs:50 — ExportedModParams::from_info 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.
D2 · Cognitive Complexity · Stmt · ×1
  • Stmt::walk (cognitive 91) src/ast/stmt.rs:837 — Stmt::walk has cognitive complexity 91 (threshold 15). Drivers by points: if/else 26 (67 pts), loops 11 (23 pts), match/switch 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent 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 · TokenIterator · ×1
  • TokenIterator::next (cognitive 52) src/tokenizer.rs:1697 — TokenIterator::next has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (38 pts), boolean chains 7, match/switch 4 (7 pts) (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Target · ×1
  • Target::propagate_changed_value (cognitive 19) src/eval/target.rs:280 — Target::propagate_changed_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · Debugger · ×1
  • Debugger::is_break_point (cognitive 17) src/eval/debugger.rs:322 — Debugger::is_break_point has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (13 pts), boolean chains 4 (nesting depth added 7). 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.
D22 · Internal API Consistency · Redundant registration methods for functions with different error handling semantics. `register_fn` and `with_fn` imply standard return types, while `register_result_fn` and `with_result_fn` imply returning `RhaiResult`. This forces users to choose based on implementation detail (whether the function returns a Result or a value) rather than a unified API. Similarly, `register_get`/`with_get` vs `register_get_result`/`with_get_result` duplicates this pattern. · ×1
  • Redundant registration methods for functions with different error handling semantics. `register_fn` and `with_fn` imply standard return types, while `register_result_fn` and `with_result_fn` imply returning `RhaiResult`. This forces users to choose based on implementation detail (whether the function returns a Result or a value) rather than a unified API. Similarly, `register_get`/`with_get` vs `register_get_result`/`with_get_result` duplicates this pattern. — Unify into a single registration method (e.g., `register_fn`) that accepts a function returning `RhaiResult` or the value type directly, handling the conversion internally. Or, enforce a strict convention where all native functions return `RhaiResult` and remove the `_result` suffixed variants. (signatures: Engine.register_fn | Engine.register_result_fn | TypeBuilder.with_fn | TypeBuilder.with_result_fn)
D22 · Internal API Consistency · Inconsistent type registration API. `register_type` takes no arguments (likely inferring name), `register_type_with_name` takes a string name, and `register_type_with_name_raw` takes identifiers. Meanwhile, `build_type` returns a builder for complex definitions. The existence of three distinct methods for simple type registration with slight signature variations is confusing. · ×1
  • Inconsistent type registration API. `register_type` takes no arguments (likely inferring name), `register_type_with_name` takes a string name, and `register_type_with_name_raw` takes identifiers. Meanwhile, `build_type` returns a builder for complex definitions. The existence of three distinct methods for simple type registration with slight signature variations is confusing. — Consolidate into `register_type(name: impl Into<Identifier>)` and `register_type_with_builder(builder: TypeBuilder)`. Remove `register_type_with_name_raw` as it duplicates intent with a more complex signature. (signatures: Engine.register_type | Engine.register_type_with_name | Engine.register_type_with_name_raw | Engine.build_type)
D22 · Internal API Consistency · Excessive duplication of execution methods with nearly identical semantics. `consume`, `eval`, and `run` appear to execute scripts/ASTs. The distinction between them is not immediately obvious from the signatures (e.g., does `consume` store it? does `eval` return a value? does `run` just execute?). Having three verbs for essentially the same action (executing code) creates cognitive load. · ×1
  • Excessive duplication of execution methods with nearly identical semantics. `consume`, `eval`, and `run` appear to execute scripts/ASTs. The distinction between them is not immediately obvious from the signatures (e.g., does `consume` store it? does `eval` return a value? does `run` just execute?). Having three verbs for essentially the same action (executing code) creates cognitive load. — Unify into `execute(script: str)` and `execute_ast(ast: AST)`. If `consume` has a distinct side effect (like storing for later), rename it to `store` or `load`. Clarify the return value semantics in a single `eval` method. (signatures: Engine.consume | Engine.consume_with_scope | Engine.consume_ast | Engine.consume_ast_with_scope | Engine.eval | Engine.eval_with_scope | Engine.eval_ast | Engine.eval_ast_with_scope | Engine.run | Engine.run_with_scope | Engine.run_ast | Engine.run_ast_with_scope)
D22 · Internal API Consistency · Inconsistent naming and grouping for compilation methods. `compile` takes a script string, `compile_file` takes a path, `compile_expression` takes a string but implies a different AST structure. The `_with_scope` variants are repetitive. `compile_into_self_contained` is an outlier in naming convention. · ×1
  • Inconsistent naming and grouping for compilation methods. `compile` takes a script string, `compile_file` takes a path, `compile_expression` takes a string but implies a different AST structure. The `_with_scope` variants are repetitive. `compile_into_self_contained` is an outlier in naming convention. — Standardize to `compile(source: Source)` where Source is an enum or trait covering String, Path, and AST. Or clearly separate `compile_script` vs `compile_expression` if the ASTs are fundamentally different, but remove the repetitive `_with_scope` suffixes by using a builder pattern or options struct for scope. (signatures: Engine.compile | Engine.compile_with_scope | Engine.compile_file | Engine.compile_file_with_scope | Engine.compile_expression | Engine.compile_expression_with_scope | Engine.compile_scripts_with_scope | Engine.compile_into_self_contained)
D22 · Internal API Consistency · Fragmented function registration on Module. There are specific methods for getters, setters, indexers, and generic functions, plus a `raw` variant. This duplicates the logic found in `Engine` and `TypeBuilder` but with even more variation. `set_fn` vs `set_native_fn` is unclear. · ×1
  • Fragmented function registration on Module. There are specific methods for getters, setters, indexers, and generic functions, plus a `raw` variant. This duplicates the logic found in `Engine` and `TypeBuilder` but with even more variation. `set_fn` vs `set_native_fn` is unclear. — Adopt a unified `register_function` method on Module that accepts a `FuncRegistration` builder or a trait object, similar to the `TypeBuilder` approach, to handle all function types (native, script, getter, setter, indexer) uniformly. (signatures: Module.set_fn | Module.set_native_fn | Module.set_script_fn | Module.set_getter_fn | Module.set_setter_fn | Module.set_getter_setter_fn | Module.set_indexer_get_fn | Module.set_indexer_set_fn | Module.set_indexer_get_set_fn | Module.set_fn_raw_with_options)
D22 · Internal API Consistency · Redundant custom type registration methods on Module. Four methods exist with slight variations in parameters (comments, raw identifiers). This mirrors the inconsistency in `Engine` and `TypeBuilder`. · ×1
  • Redundant custom type registration methods on Module. Four methods exist with slight variations in parameters (comments, raw identifiers). This mirrors the inconsistency in `Engine` and `TypeBuilder`. — Unify into `set_custom_type(name: impl Into<Identifier>, comments: &[&str])` and remove the `_raw` and `_with_comments` variants. (signatures: Module.set_custom_type | Module.set_custom_type_with_comments | Module.set_custom_type_raw | Module.set_custom_type_with_comments_raw)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D3 · God Classes · TooManyFunctions · ×1
  • TooManyFunctions: rhai::packages::blob_basic::blob_functions src/packages/blob_basic.rs:40 — TooManyFunctions — 37 free functions. The bar is 30 free functions; this is 7 over it, 1.23× 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.
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
D4 · Code Duplication · Near-duplicate member pair (66 shared lines) · ×1
  • Near-duplicate member pair (66 shared lines) src/packages/array_basic.rs:1633 — src/packages/array_basic.rs:1633-1707 | src/packages/array_basic.rs:1732-1830 — These two members are variants of one another: 66 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Near-duplicate member pair (63 shared lines) · ×1
  • Near-duplicate member pair (63 shared lines) src/types/dynamic.rs:484 — src/types/dynamic.rs:484-634 | src/types/dynamic.rs:640-813 — These two members are variants of one another: 63 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Duplicated block (12–60 lines × 2) · ×1
  • Duplicated block (12–60 lines × 2) src/tokenizer.rs:74 — src/tokenizer.rs:74-133 | src/tokenizer.rs:194-205 — both copies are in the same file, so extract the 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 (33 lines × 2) · ×1
  • Duplicated block (33 lines × 2) src/types/error.rs:487 — src/types/error.rs:487-519 | src/types/error.rs:549-581 — both copies are in the same file, so extract the 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 (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) src/packages/string_more.rs:646 — src/packages/string_more.rs:646-672 | src/packages/string_more.rs:726-752 — both copies are in the same file, so extract the 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 (22–23 lines × 2) · ×1
  • Duplicated block (22–23 lines × 2) src/packages/string_more.rs:1282 — src/packages/string_more.rs:1282-1304 | src/packages/string_more.rs:1353-1374 — both copies are in the same file, so extract the 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 (22 lines × 3) · ×1
  • Duplicated block (22 lines × 3) codegen/src/lib.rs:349 — codegen/src/lib.rs:349-370 | codegen/src/lib.rs:380-401 | codegen/src/lib.rs:411-432 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) src/parser.rs:650 — src/parser.rs:650-668 | src/parser.rs:718-736 — both copies are in the same file, so extract the 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 (18 lines × 2) · ×1
  • Duplicated block (18 lines × 2) src/packages/array_basic.rs:1634 — src/packages/array_basic.rs:1634-1651 | src/packages/array_basic.rs:1733-1750 — both copies are in the same file, so extract the 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 (15–16 lines × 2) · ×1
  • Duplicated block (15–16 lines × 2) src/func/hashing.rs:100 — src/func/hashing.rs:100-115 | src/func/hashing.rs:138-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.
D4 · Code Duplication · Duplicated block (12–16 lines × 2) · ×1
  • Duplicated block (12–16 lines × 2) src/parser.rs:2243 — src/parser.rs:2243-2254 | src/parser.rs:2297-2312 — both copies are in the same file, so extract the 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 (14–15 lines × 3) · ×1
  • Duplicated block (14–15 lines × 3) src/eval/chaining.rs:446 — src/eval/chaining.rs:446-459 | src/eval/chaining.rs:656-670 | src/eval/chaining.rs:780-794 — 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 (14 lines × 4) · ×1
  • Duplicated block (14 lines × 4) src/module/mod.rs:2005 — src/module/mod.rs:2005-2018 | src/module/mod.rs:2038-2051 | src/module/mod.rs:2085-2098 | src/module/mod.rs:2140-2153 — 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.
D4 · Code Duplication · Duplicated block (12–14 lines × 2) · ×1
  • Duplicated block (12–14 lines × 2) src/grain/vm/mod.rs:442 — src/grain/vm/mod.rs:442-453 | src/grain/vm/mod.rs:490-503 — both copies are in the same file, so extract the 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 (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) src/parser.rs:3185 — src/parser.rs:3185-3197 | src/parser.rs:4046-4059 — both copies are in the same file, so extract the 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 (11–12 lines × 2) · ×1
  • Duplicated block (11–12 lines × 2) src/parser.rs:2129 — src/parser.rs:2129-2139 | src/parser.rs:2184-2195 — both copies are in the same file, so extract the 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 (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) src/eval/chaining.rs:276 — src/eval/chaining.rs:276-286 | src/eval/chaining.rs:332-342 | src/eval/chaining.rs:400-410 | src/eval/chaining.rs:470-480 | src/eval/chaining.rs:498-508 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) src/bin/rhai-dbg.rs:408 — src/bin/rhai-dbg.rs:408-418 | src/bin/rhai-dbg.rs:431-441 | src/bin/rhai-dbg.rs:454-464 — 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 (10–11 lines × 2) · ×1
  • Duplicated block (10–11 lines × 2) src/parser.rs:992 — src/parser.rs:992-1002 | src/parser.rs:1125-1134 — both copies are in the same file, so extract the 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 (10 lines × 4) · ×1
  • Duplicated block (10 lines × 4) src/packages/math_basic.rs:464 — src/packages/math_basic.rs:464-473 | src/packages/math_basic.rs:481-490 | src/packages/math_basic.rs:498-507 | src/packages/math_basic.rs:515-524 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 3) · ×1
  • Duplicated block (10 lines × 3) src/serde/ser.rs:461 — src/serde/ser.rs:461-470 | src/serde/ser.rs:497-506 | src/serde/ser.rs:532-541 — 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–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) src/eval/chaining.rs:146 — src/eval/chaining.rs:146-155 | src/eval/chaining.rs:176-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (7–9 lines × 2) · ×1
  • Duplicated block (7–9 lines × 2) src/ast/stmt.rs:655 — src/ast/stmt.rs:655-661 | src/ast/stmt.rs:687-695 — both copies are in the same file, so extract the 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 (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) src/eval/chaining.rs:329 — src/eval/chaining.rs:329-334 | src/eval/chaining.rs:397-402 | src/eval/chaining.rs:495-500 | src/eval/chaining.rs:625-630 — 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.
D4 · Code Duplication · Duplicated block (6 lines × 3) · ×1
  • Duplicated block (6 lines × 3) src/types/dynamic.rs:505 — src/types/dynamic.rs:505-510 | src/types/dynamic.rs:673-678 | src/types/dynamic.rs:1228-1233 — 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 (2–5 lines × 3) · ×1
  • Duplicated block (2–5 lines × 3) src/func/builtin.rs:178 — src/func/builtin.rs:178-179 | src/func/builtin.rs:190-194 | src/func/builtin.rs:212-216 — 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 (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) src/packages/array_basic.rs:44 — src/packages/array_basic.rs:44-50 | src/packages/array_basic.rs:766-772 | src/packages/array_basic.rs:1211-1217 — 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 (12 lines × 7) · ×1
  • Duplicated block (12 lines × 7) codegen/ui_tests/export_fn_bad_attr.rs:11 — codegen/ui_tests/export_fn_bad_attr.rs:11-22 | codegen/ui_tests/export_fn_bad_value.rs:11-22 | codegen/ui_tests/export_fn_extra_value.rs:11-22 | codegen/ui_tests/export_fn_junk_arg.rs:11-22 | codegen/ui_tests/export_fn_missing_value.rs:11-22 | codegen/ui_tests/export_fn_path_attr.rs:11-22 | codegen/ui_tests/export_fn_raw_return.rs:11-22 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 7 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16 lines × 8) · ×1
  • Duplicated block (16 lines × 8) codegen/ui_tests/export_mod_bad_attr.rs:12 — codegen/ui_tests/export_mod_bad_attr.rs:12-27 | codegen/ui_tests/export_mod_bad_value.rs:12-27 | codegen/ui_tests/export_mod_cfg.rs:13-28 | codegen/ui_tests/export_mod_extra_value.rs:12-27 | codegen/ui_tests/export_mod_junk_arg.rs:12-27 | codegen/ui_tests/export_mod_missing_value.rs:12-27 | codegen/ui_tests/export_mod_path_attr.rs:12-27 | codegen/ui_tests/export_mod_raw_return.rs:12-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 8 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (16 lines × 27) · ×1
  • Duplicated block (16 lines × 27) codegen/ui_tests/rhai_fn_bad_attr.rs:12 — codegen/ui_tests/rhai_fn_bad_attr.rs:12-27 | codegen/ui_tests/rhai_fn_bad_value.rs:12-27 | codegen/ui_tests/rhai_fn_extra_value.rs:12-27 | codegen/ui_tests/rhai_fn_getter_conflict.rs:13-28 | codegen/ui_tests/rhai_fn_getter_multiple.rs:13-28 | codegen/ui_tests/rhai_fn_index_getter_multiple.rs:13-28 | codegen/ui_tests/rhai_fn_index_getter_signature.rs:13-28 | codegen/ui_tests/rhai_fn_index_setter_multiple.rs:13-28 | codegen/ui_tests/rhai_fn_junk_arg.rs:12-27 | codegen/ui_tests/rhai_fn_missing_value.rs:12-27 | codegen/ui_tests/rhai_fn_path_attr.rs:12-27 | codegen/ui_tests/rhai_fn_rename_collision.rs:13-33 | codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs:13-32 | codegen/ui_tests/rhai_fn_rename_to_index_getter.rs:13-28 | codegen/ui_tests/rhai_fn_rename_to_index_setter.rs:13-28 | codegen/ui_tests/rhai_fn_rename_to_prop_getter.rs:13-28 | codegen/ui_tests/rhai_fn_rename_to_prop_setter.rs:13-28 | codegen/ui_tests/rhai_fn_setter_index_signature.rs:13-28 | codegen/ui_tests/rhai_fn_setter_multiple.rs:13-28 | codegen/ui_tests/rhai_fn_setter_signature.rs:13-28 | codegen/ui_tests/rhai_mod_bad_attr.rs:13-29 | codegen/ui_tests/rhai_mod_bad_value.rs:13-29 | codegen/ui_tests/rhai_mod_junk_arg.rs:13-29 | codegen/ui_tests/rhai_mod_missing_value.rs:13-29 | codegen/ui_tests/rhai_mod_name_collisions.rs:12-31 | codegen/ui_tests/rhai_mod_path_attr.rs:13-29 | codegen/ui_tests/rhai_mod_return_raw.rs:13-29 — before extracting anything, compare `codegen/ui_tests/rhai_fn_rename_collision.rs` and `codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) codegen/ui_tests/rhai_fn_global_multiple.rs:13 — codegen/ui_tests/rhai_fn_global_multiple.rs:13-28 | codegen/ui_tests/rhai_fn_rename_collision_oneattr_multiple.rs:13-30 | codegen/ui_tests/rhai_fn_rename_collision_with_itself.rs:13-25 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (20 lines × 3) · ×1
  • Duplicated block (20 lines × 3) codegen/ui_tests/rhai_fn_rename_collision.rs:13 — codegen/ui_tests/rhai_fn_rename_collision.rs:13-33 | codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs:13-32 | codegen/ui_tests/rhai_mod_name_collisions.rs:12-31 — before extracting anything, compare `codegen/ui_tests/rhai_fn_rename_collision.rs` and `codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (16 lines × 4) · ×1
  • Duplicated block (16 lines × 4) codegen/ui_tests/rhai_fn_rename_collision.rs:13 — codegen/ui_tests/rhai_fn_rename_collision.rs:13-33 | codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs:13-32 | codegen/ui_tests/rhai_mod_name_collisions.rs:12-31 | codegen/ui_tests/rhai_mod_unknown_type_return.rs:12-27 — before extracting anything, compare `codegen/ui_tests/rhai_fn_rename_collision.rs` and `codegen/ui_tests/rhai_fn_rename_collision_oneattr.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Minor — 9 finding(s)
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 3.3/10. The most over is `(repository root)` (68359 LoC, 248 public types across 19 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D34 · Knowledge Freshness · Orphaned files with no living knowledge · ×1
  • Orphaned files with no living knowledge — 2 of 119 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 119 of the 206 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: fuzz/fuzz_targets/scripting.rs, fuzz/fuzz_targets/fuzz_serde.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 1/2 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `codegen`.

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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-91b8fa9c161748528001e315f414aafa/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/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-91b8fa9c161748528001e315f414aafa/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/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .74artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—
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—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.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 Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—

Run 01a0ef87-985a-71aa-8063-6dbed86cf269 · 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