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

biomejs/gritql

Measured 14 November 2026, 20:03 UTC, at code version b3e9e54

Code coverage is not measured: .NET and JavaScript/TypeScript suite (CouldNotMeasureEnvironment, CouldNotMeasureTestRunFailed).

CAI score 62out of 100 At risk Down 1 since the last survey

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

A medium codebase: 70,751 lines of product code in 32 projects, tests not counted · Estimated rebuild effort: about 0.5 person-years · Weakest lens: Code Health, 56

Findings by how serious they are

88 critical 390 serious 237 minor

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

This survey was produced by

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

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

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

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

48of 48 dimensions measured by tools.
694of 715 findings point to an exact file and line, so you can open each one in the code. The other 21 concern the repository as a whole, such as missing documentation.
48dimensions across 8 lenses, read from 70,751 lines of product code in 32 projects.
Chapters

Executive summary

biomejs/gritql is rated At risk because critical security findings are open, most of them in the packages it uses. It scores 62 out of 100, which the At risk rating leaves unchanged.

Code Health, at 56, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the test that is switched off, worth about 3 points. Turning on missing-value checks would lift Code Health itself, worth about 5 points. Raising Code Health to 70 would lift the score to about 66.

Seventy-nine known security holes in the packages the code depends on can be used by attackers. Three pipeline steps install packages that can change without warning, and three pipeline steps run downloads nobody checks. Updating the vulnerable packages, pinning what the pipeline installs and checking each download against a checksum would close these risks. Pinning each tool to an exact version would fix the two pipeline tools referenced by a changeable name, and the place where the code runs text as code or as a command needs a direct call instead.

The product code is 70,751 lines, about €72,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Code Health 56 · counts for 45%Production Readiness 61 · counts for 25%Security and Compliance 65 · counts for 14%Maturity 70 · counts for 8%Performance 85 · counts for 4%Architecture 99 · counts for 2%Domain Modelling 100 · counts for 1%Event Sourcing 100 · counts for 1%

If Code Health rose from 56 to 70, the lowest score rated Strong, the score would rise from 62 to about 66.

Code composition: what the lines of code are
Product code 93%Tests 7%
New since the last survey: 113 findings

These 113 critical or serious findings weren't in the previous survey, on 28 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.

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

Fixed since the last survey: 19 findings

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

  • Code Duplication · Duplicated block (18–19 lines × 2) crates/gritmodule/src/resolver.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/core/src/marzano_resolved_pattern.rs
  • Code Duplication · Duplicated block (15 lines × 2) crates/grit-pattern-matcher/src/errors.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/cli/src/commands/workflows_watch.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/core/src/pattern_compiler/step_compiler.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/grit-pattern-matcher/src/pattern/match.rs
  • Code Duplication · Duplicated block (9 lines × 2) crates/core/src/pattern_compiler/auto_wrap.rs
  • Code Duplication · Duplicated block (8 lines × 5) crates/core/src/optimizer/hoist_files.rs
  • Code Duplication · Duplicated block (8 lines × 5) crates/core/src/optimizer/hoist_text.rs
  • Code Duplication · Duplicated block (5 lines × 2) crates/grit-pattern-matcher/src/pattern/float_constant.rs
  • Code Duplication · Duplicated block (10 lines × 2) crates/core/src/pattern_compiler/as_compiler.rs
  • Code Duplication · Duplicated block (8 lines × 4) crates/gritmodule/src/formatting.rs
  • Code Duplication · Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/back_tick_compiler.rs
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · High CVE: REDACTED REDACTED
  • Dependency Vulnerabilities · Medium vulnerability: [GHSA redacted] REDACTED
Rebuild cost: about €72,000 · Estimate
Cost to rebuild€24,000 to €120,000, for 400 to 1,270 hours of work, about 0.5 person-years for one engineer
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 62. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeMedium: 70,751 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Resolve the 1 Skipped test finding(s) in Test Quality — start with napi.spec.mts.
Raises the score by about 3 points · Low effort · Test Quality
2
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Raises the score by about 5 points · Medium effort · Nullable reference types
3
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Generator.csproj.
Raises the score by about 2 points · Low effort · ADR Quality

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €72,000 to build again, about 0.5 person-years of work. Its weakest lens is Code Health, at 56 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Skipped test finding(s) in Test Quality. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 1 Test Quality findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 8,463 lines over the last 90 days, which is about 34,322 lines a year. At that pace, the extra work comes to an estimated 1.7 to 11.4 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch @getgrit/docs docs grit-wasm-bindings (npm) grit-wasm-bindings (npm) @getgrit/docs->grit-wasm-bindings (npm) @getgrit/gritql gritql @getgrit/gritql-android-arm64 gritql-android-arm64 @getgrit/gritql-darwin-arm64 gritql-darwin-arm64 grit grit marzano-cli marzano-cli grit->marzano-cli marzano-util marzano-util grit->marzano-util grit-pattern-matcher grit-pattern-matcher grit-util grit-util grit-pattern-matcher->grit-util grit-wasm-bindings (Cargo) grit-wasm-bindings (Cargo) grit-wasm-bindings (Cargo)->grit-util marzano-core marzano-core grit-wasm-bindings (Cargo)->marzano-core marzano-language marzano-language grit-wasm-bindings (Cargo)->marzano-language grit-wasm-bindings (Cargo)->marzano-util grit_cache grit_cache marzano-gritmodule marzano-gritmodule grit_cache->marzano-gritmodule grit_cache->marzano-util gritql_napi gritql_napi gritql_napi->grit-pattern-matcher gritql_napi->grit-util gritql_napi->marzano-core gritql_napi->marzano-gritmodule gritql_napi->marzano-language gritql_napi->marzano-util marzano_messenger marzano_messenger gritql_napi->marzano_messenger marzano-auth marzano-auth marzano-auth->marzano-util marzano-cli->grit-pattern-matcher marzano-cli->grit-util marzano-cli->grit_cache marzano-cli->marzano-auth marzano-cli->marzano-core marzano-cli->marzano-gritmodule marzano-cli->marzano-language marzano-lsp marzano-lsp marzano-cli->marzano-lsp marzano-cli->marzano-util marzano-cli->marzano_messenger marzano-core->grit-pattern-matcher marzano-core->grit-util marzano-externals marzano-externals marzano-core->marzano-externals marzano-core->marzano-language marzano-core->marzano-util marzano-gritmodule->grit-util marzano-gritmodule->marzano-core marzano-gritmodule->marzano-language marzano-gritmodule->marzano-util marzano-language->grit-util marzano-language->marzano-util marzano-lsp->grit-util marzano-lsp->grit_cache marzano-lsp->marzano-core marzano-lsp->marzano-gritmodule marzano-lsp->marzano-language marzano-lsp->marzano-util marzano-util->grit-util marzano_messenger->grit-util marzano_messenger->marzano-core marzano_messenger->marzano-language __more__ +12 more projects

Architecture: which parts of the code depend on which

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

432 modules, with 982 dependencies between them. 6 loops run through 37 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 grit_util.code_range2 grit_util.ranges3 marzano_cli.flags4 marzano_gritmodule.fetcher5 marzano_util.rich_path6 grit_pattern_matcher.pattern.iter_pattern7 grit_util.analysis_logs8 grit_util.language9 marzano_util.node_with_source10 grit_pattern_matcher.pattern.variable11 marzano_language.language12 grit_pattern_matcher.pattern.state13 marzano_language.target_language14 grit_pattern_matcher.effects15 grit_pattern_matcher.pattern.accessor16 grit_pattern_matcher.pattern.list_index17 grit_pattern_matcher.pattern.range18 grit_pattern_matcher.pattern.resolved_pattern19 grit_pattern_matcher.pattern.dynamic_snippet20 grit_pattern_matcher.pattern.patterns21 grit_pattern_matcher.pattern.functions22 grit_pattern_matcher.pattern.pattern_definition23 grit_pattern_matcher.pattern.predicates24 grit_pattern_matcher.pattern.function_definition25 grit_pattern_matcher.pattern.predicate_definition26 grit_pattern_matcher.context27 grit_pattern_matcher.binding28 marzano_core.marzano_binding29 marzano_core.marzano_resolved_pattern30 marzano_core.marzano_context31 marzano_core.ast_node32 marzano_core.built_in_functions33 marzano_core.pattern_compiler.builder34 marzano_core.pattern_compiler.compiler35 marzano_core.pattern_compiler.node_compiler36 marzano_core.problem37 marzano_core.api38 marzano_gritmodule.config39 marzano_messenger.emit40 marzano_cli.messenger_variant
1 grit_util.code_range
2 grit_util.ranges
3 marzano_cli.flags
4 marzano_gritmodule.fetcher
5 marzano_util.rich_path
6 grit_pattern_matcher.pattern.iter_pattern113
7 grit_util.analysis_logs1
8 grit_util.language12
9 marzano_util.node_with_source12
10 grit_pattern_matcher.pattern.variable11221211
11 marzano_language.language1112
12 grit_pattern_matcher.pattern.state11222
13 marzano_language.target_language11314
14 grit_pattern_matcher.effects1211
15 grit_pattern_matcher.pattern.accessor1122222
16 grit_pattern_matcher.pattern.list_index1111122
17 grit_pattern_matcher.pattern.range111121
18 grit_pattern_matcher.pattern.resolved_pattern145811112112
19 grit_pattern_matcher.pattern.dynamic_snippet111132
20 grit_pattern_matcher.pattern.patterns222213
21 grit_pattern_matcher.pattern.functions44143
22 grit_pattern_matcher.pattern.pattern_definition11111
23 grit_pattern_matcher.pattern.predicates211112
24 grit_pattern_matcher.pattern.function_definition2212
25 grit_pattern_matcher.pattern.predicate_definition1111
26 grit_pattern_matcher.context11121111
27 grit_pattern_matcher.binding11112111
28 marzano_core.marzano_binding22212211
29 marzano_core.marzano_resolved_pattern11152111321111
30 marzano_core.marzano_context1111111121
31 marzano_core.ast_node121124122
32 marzano_core.built_in_functions33113
33 marzano_core.pattern_compiler.builder111111111111
34 marzano_core.pattern_compiler.compiler43134322221
35 marzano_core.pattern_compiler.node_compiler11
36 marzano_core.problem1211111112112
37 marzano_core.api131
38 marzano_gritmodule.config2322
39 marzano_messenger.emit12
40 marzano_cli.messenger_variant124
Uses a module listed above itPart of a loopThe module itself
1 grit_util.code_range2 grit_util.ranges3 marzano_cli.flags4 marzano_gritmodule.fetcher5 marzano_util.rich_path6 grit_pattern_matcher.pattern.iter_pattern7 grit_util.analysis_logs8 grit_util.language9 marzano_util.node_with_source10 grit_pattern_matcher.pattern.variable11 marzano_language.language12 grit_pattern_matcher.pattern.state13 marzano_language.target_language14 grit_pattern_matcher.effects15 grit_pattern_matcher.pattern.accessor16 grit_pattern_matcher.pattern.list_index17 grit_pattern_matcher.pattern.range18 grit_pattern_matcher.pattern.resolved_pattern19 grit_pattern_matcher.pattern.dynamic_snippet20 grit_pattern_matcher.pattern.patterns21 grit_pattern_matcher.pattern.functions22 grit_pattern_matcher.pattern.pattern_definition23 grit_pattern_matcher.pattern.predicates24 grit_pattern_matcher.pattern.function_definition25 grit_pattern_matcher.pattern.predicate_definition26 grit_pattern_matcher.context27 grit_pattern_matcher.binding28 marzano_core.marzano_binding29 marzano_core.marzano_resolved_pattern30 marzano_core.marzano_context31 marzano_core.ast_node32 marzano_core.built_in_functions33 marzano_core.pattern_compiler.builder34 marzano_core.pattern_compiler.compiler35 marzano_core.pattern_compiler.node_compiler36 marzano_core.problem37 marzano_core.api38 marzano_gritmodule.config39 marzano_messenger.emit40 marzano_cli.messenger_variantgrit_util.code_range1grit_util.ranges2marzano_cli.flags3marzano_gritmodule.fetcher4marzano_util.rich_path5grit_pattern_matcher.pattern.iter_pattern6grit_util.analysis_logs7grit_util.language8marzano_util.node_with_source9grit_pattern_matcher.pattern.variable10marzano_language.language11grit_pattern_matcher.pattern.state12marzano_language.target_language13grit_pattern_matcher.effects14grit_pattern_matcher.pattern.accessor15grit_pattern_matcher.pattern.list_index16grit_pattern_matcher.pattern.range17grit_pattern_matcher.pattern.resolved_pattern18grit_pattern_matcher.pattern.dynamic_snippet19grit_pattern_matcher.pattern.patterns20grit_pattern_matcher.pattern.functions21grit_pattern_matcher.pattern.pattern_definition22grit_pattern_matcher.pattern.predicates23grit_pattern_matcher.pattern.function_definition24grit_pattern_matcher.pattern.predicate_definition25grit_pattern_matcher.context26grit_pattern_matcher.binding27marzano_core.marzano_binding28marzano_core.marzano_resolved_pattern29marzano_core.marzano_context30marzano_core.ast_node31marzano_core.built_in_functions32marzano_core.pattern_compiler.builder33marzano_core.pattern_compiler.compiler34marzano_core.pattern_compiler.node_compiler35marzano_core.problem36marzano_core.api37marzano_gritmodule.config38marzano_messenger.emit39marzano_cli.messenger_variant401131121211221211111211222113141211112222211111221111211458111121121111322222134414311111211112221211111112111111112111222122111115211132111111111111211211241223311311111111111143134322221111211111112112131232212124+392 more modules (most-connected shown)

At a glance — Code Health · 56% · Adequate · gated by X5 ·

At a glance — Architecture · 99% · Exemplary ·

At a glance — Maturity · 70% · Adequate · gated by D34 ·

At a glance — Readiness · 61% · Adequate · gated by D12 ·

At a glance — Security · 65% · Adequate · gated by D29, D44 ·

At a glance — Domain Modelling · 100% · Exemplary ·

At a glance — Event Sourcing · 100% · Exemplary ·

At a glance — Performance · 85% · Strong ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2025 — Software Supply Chain Failures151High / Critical
A05:2025 — Injection16High / Critical

Roadmap

Top priorities: Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`; Bring the 36 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51), marzano_cli::commands::check::run_check (cyclomatic 44), marzano_cli::commands::run_command (cyclomatic 39); Resolve the 1 Skipped test finding(s) in Test Quality — start with napi.spec.mts.

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

Do thisHelpsEffortDimension
Resolve the 1 Skipped test finding(s) in Test Quality — start with napi.spec.mts.+2.9 ptsLowTest Quality
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.+5.1 ptsMediumNullable reference types
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Generator.csproj.+1.7 ptsLowADR Quality
Resolve the 3 End-of-life runtime finding(s) in Platform End-of-Life — start with Generator.csproj, REDACTED, rust-toolchain.toml.+1.1 ptsLowPlatform End-of-Life
Enable Dependabot/Renovate or a dependency-review gate.+1.8 ptsMediumSecurity & performance tooling
Bring the 36 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51), marzano_cli::commands::check::run_check (cyclomatic 44), marzano_cli::commands::run_command (cyclomatic 39).+3.0 ptsHighCyclomatic Complexity
Resolve the 3 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene.+0.6 ptsLowDependency Hygiene
Resolve the 12 Documentation finding(s) in Documentation Quality — start with README.md (12).+1.1 ptsMediumDocumentation Quality

File quality

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

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.5SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.6SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.6SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.3SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED2.5SlopDependency Vulnerabilities: High CVE: REDACTED
REDACTED4.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED4.4MixedDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedDependency Vulnerabilities: High CVE: REDACTED
crates/cli/src/result_formatting.rs5.7MixedCyclomatic Complexity: FormattedResult::fmt (cyclomatic 25)
crates/cli/src/commands/apply_pattern.rs5.9MixedCyclomatic Complexity: marzano_cli::commands::apply_pattern::run_apply_pattern (cyclomatic 39)
crates/language/src/js_like.rs6.3MixedCyclomatic Complexity: marzano_language::js_like::jslike_check_replacements (cyclomatic 20)
REDACTED6.4MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED6.9MixedStatic Analysis (SAST): Medium: REDACTED
crates/core/src/inline_snippets.rs7.0MixedCyclomatic Complexity: marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51)
crates/core/src/optimizer/hoist_files.rs7.0MixedCyclomatic Complexity: marzano_core::optimizer::hoist_files::extract_filename_pattern (cyclomatic 35)
crates/core/src/pattern_compiler/auto_wrap.rs7.0MixedCognitive Complexity: marzano_core::pattern_compiler::auto_wrap::auto_wrap_pattern (cognitive 24)

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

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

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

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

Could not be resolved — 10

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

Methodology & how to trust this report

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

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

What we checked — 48 dimensions across the health lenses
D1D2D3D4D5D6D10D12D13D14D15D16D17D19D20D24D28D29D30D31D34D35D36D37D43D44AX10AX3AX4AX5AX8AX9DM4DM5ES2GD1M1M2M3M4P1P10P2P3P4P6PF3X5

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, 694 of 715 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

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

Every finding is locatable in findings.md. Run 01a1dba8-728c-7439-830e-07dc4ffc31c7.

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.

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 7 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 19 test source file(s) (.rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (bun:test via `npm install --ignore-scripts` (no lockfile) in js/gritql/ (6 tests); node:test via `npm ci --ignore-scripts` in resources/language-metavariables/tree-sitter-c-sharp/ (1 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Cargo manifest, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its gem dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its gem dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D17 Explicit Debt — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 0 deducted marker(s) and the 0.0/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (62,953 lines, 90% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 67 task marker(s) (TODO/FIXME/HACK/XXX) across 44 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's naming rules read C# through Roslyn and every other language through its sidecar model; these languages are left out (PHP's reading is its own change, a Roslyn-loaded VB or F# project has no population builder yet). Their declarations carry no naming verdict this run — this says nothing about whether their names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DevServer (dev). the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): REDACTED has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X27 Collection changed while being enumerated — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.

Repo exclusion declarations: 29 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, 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.
  • DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

Dimensions

D1 · Cyclomatic Complexity6.7 / 10Adequate✓ 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 6.7 / 10 · rule-coverage 100% · ceiling Prevented

36 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was marzano_core::inline_snippets::get_deletion_indices at 51. A further 60 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being MarzanoCodeSnippet::execute at 57 — they are counted neither in the figure above nor in this dimension's score. 10 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: crates/core/src/marzano_code_snippet.rs (MarzanoCodeSnippet::execute at 57), crates/grit-pattern-matcher/src/pattern/iter_pattern.rs (Pattern::children at 56), crates/grit-pattern-matcher/src/pattern/patterns.rs (Pattern::execute at 54), crates/core/src/pattern_compiler/pattern_compiler.rs (PatternCompiler::from_node_with_rhs at 49), crates/gritmodule/src/patterns_directory.rs (PatternsDirectory::get_language_directory_mut at 25), and 5 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

marzano_cli::commands::check::run_check (cyclomatic 44) · ×6crates/cli/src/commands/check.rs:76
marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51) · ×5crates/core/src/inline_snippets.rs:518
marzano_gritmodule::formatting::format_temp_dir (cyclomatic 35) · ×4crates/gritmodule/src/formatting.rs:72
Predicate::extract_body_pattern (cyclomatic 25) · ×2crates/core/src/optimizer/hoist_text.rs:317
marzano_language::js_like::jslike_check_replacements (cyclomatic 20) · ×2crates/language/src/js_like.rs:170

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

What to do

  1. Bring the 36 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51), marzano_cli::commands::check::run_check (cyclomatic 44), marzano_cli::commands::run_command (cyclomatic 39). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 36 together lifts Cyclomatic Complexity from 6.7 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D2 · Cognitive Complexity5.2 / 10Adequate✓ 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 5.2 / 10 · rule-coverage 100% · ceiling Prevented

71 method(s) exceeded the cognitive complexity threshold of 15; the worst was marzano_core::inline_snippets::get_deletion_indices at 113.

marzano_core::inline_snippets::get_deletion_indices (cognitive 113) · ×15crates/core/src/inline_snippets.rs:518
marzano_cli::commands::check::run_check (cognitive 80) · ×9crates/cli/src/commands/check.rs:76
marzano_gritmodule::formatting::format_temp_dir (cognitive 84) · ×8crates/gritmodule/src/formatting.rs:72
grit_pattern_matcher::pattern::list::execute_assoc (cognitive 39) · ×3crates/grit-pattern-matcher/src/pattern/list.rs:57
marzano_util::diff::parse_modified_ranges (cognitive 40) · ×2crates/util/src/diff.rs:70

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

What to do

  1. Bring the 8 bodies over 60 down to 60 or less in Cognitive Complexity — start with marzano_core::inline_snippets::get_deletion_indices (cognitive 113), marzano_gritmodule::formatting::format_temp_dir (cognitive 84), marzano_cli::commands::check::run_check (cognitive 80). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 8 together lifts Cognitive Complexity from 5.2 to about 6.0/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

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

30 god class(es) detected.

FunctionTooLong: marzano_cli::commands::apply_pattern::run_apply_pattern · ×12crates/cli/src/commands/apply_pattern.rs:200
MethodTooLong: MarzanoContext.exec_step · ×9crates/core/src/marzano_context.rs:192
FileTooLong: src/marzano_resolved_pattern.rs · ×7crates/core/src/marzano_resolved_pattern.rs
ClassTooLong: MarzanoResolvedPattern · ×2crates/core/src/marzano_resolved_pattern.rs:30

What to do

  1. Resolve the 12 FunctionTooLong finding(s) in God Classes — start with testing.rs (2), apply_pattern.rs, check.rs. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 9 MethodTooLong finding(s) in God Classes — start with marzano_context.rs, contains.rs, notebooks.rs. — One of this dimension's main actionable groups (9 warning-level).
  3. Resolve the 7 FileTooLong finding(s) in God Classes — start with marzano_resolved_pattern.rs, target_language.rs, api.rs. — One of this dimension's main actionable groups (7 warning-level).

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

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

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

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

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

90 duplicated block group(s) detected. 4.6 % of the production lines (3,274 of 70,751) are in a reported copy. A further 50 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Duplicated block (7 lines × 2) · ×12crates/core/src/analysis.rs:144
Duplicated block (10 lines × 2) · ×8crates/core/src/inline_snippets.rs:445
Duplicated block (9 lines × 2) · ×7crates/core/src/marzano_resolved_pattern.rs:468
Duplicated block (6 lines × 2) · ×7crates/cli/src/result_formatting.rs:291
Edited copy of a member (11 corresponding lines) · ×6crates/core/src/pattern_compiler/back_tick_compiler.rs:20

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

What to do

  1. Resolve the 12 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with compiler.rs (3), analysis.rs, marzano_resolved_pattern.rs. — One of this dimension's main actionable groups (12 warning-level).
  2. Resolve the 8 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with match.rs (2), inline_snippets.rs, hoist_files.rs. — One of this dimension's main actionable groups (8 warning-level).
  3. Resolve the 7 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with auto_wrap.rs (2), marzano_resolved_pattern.rs, accumulate_compiler.rs. — One of this dimension's main actionable groups (7 warning-level).

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

D5 · Coupling9.2 / 10Stronggated by 3 serious findings✓ 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 9.2 / 10 · rule-coverage 100% · ceiling Prevented

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

Off the main sequence: grit-util · ×2
Unstable project marzano-lsp

What to do

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

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

D6 · Cohesion (LCOM4)9.8 / 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.8 / 10 · rule-coverage 100% · ceiling Verified

2 of 109 classes have LCOM4 above 3.

Low cohesion: TransformedMessenger (LCOM4 6) · ×2crates/cli/src/result_formatting.rs:458

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with result_formatting.rs, pattern_sdk.rs. — One of this dimension's main actionable groups (2 warning-level).

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

D10 · Test Quality7.5 / 10Strong✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

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

1 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 7 tests. Measured on the JavaScript/TypeScript suite only — at least 19 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.

Skipped test: can run inside a storage contextjs/gritql/__test__/napi.spec.mts:14

What to do

  1. Resolve the 1 Skipped test finding(s) in Test Quality — start with napi.spec.mts. — One of this dimension's main actionable groups (1 warning-level).

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

D12 · Dependency Hygiene8.2 2.7 / 10Weak✓ Tool-verified

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

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

Maturity: Documented → Verified → Prevented · effective 2.7 / 10 · rule-coverage 33% · ceiling Verified

1 outdated, 0 author-deprecated direct Go module(s), 7 pinning or checksum defect(s). 6 of 6 direct requirement(s) were graded against proxy.golang.org (0 not served there, 4 publishing no tagged release to be behind). Whether any of these modules is UNMAINTAINED is not graded — proxy.golang.org publishes no maintenance status, and release age does not stand in for one. Whether any is UNUSED is not graded either: that is a source question, not a registry one. Known CVEs in this module graph are D30's question, read from REDACTED and go.sum there.

Dependency pinned to a stale untagged commit: github.com/smacker/go-tree-sitter · ×3
No go.sum committed (REDACTED)
No go.sum committed (REDACTED)
No go.sum committed (REDACTED)
No go.sum committed (REDACTED)

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

What to do

  1. Resolve the 3 Dependency pinned to a stale untagged commit finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 1 No go.sum committed (resources/language-metavariables/tree-sitter-java/b… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 No go.sum committed (resources/language-metavariables/tree-sitter-kotlin… finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).

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

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

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

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

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

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

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

0 of 29 shipped gem(s) use a banned license. Licences were resolved from rubygems.org over the 29 gem(s) a consumer installs — this repository's runtime declarations closed transitively over its committed Gemfile.lock. Development-group and `add_development_dependency` gems are excluded: they are not distributed with this repository. ★ COVERAGE OF THIS VERDICT: it grades this repository's gem dependencies and nothing else. The repository also declares a Cargo manifest, REDACTED and a Python pyproject.toml/requirements.txt (pip/uv/Poetry), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No churn × complexity hotspots in the window.

✓ On the Gold path — maintain.

Detailed fixes: d15_recommendation.md.

D16 · Bus Factor9.8 / 10Exemplary✓ Tool-verified

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

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

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

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

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt10.0 / 10Exemplary○ Nothing flagged

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

0 deducted debt markers + 0 dead symbols across 149 LoC in the .NET projects (0.0/KLoC) → score 10.0. Measured on the .NET source only: .rs (90% of production source) was not read, and carries at least 67 uncounted task marker(s) in 44 file(s).

✓ On the Gold path — maintain.

Detailed fixes: d17_recommendation.md.

D19 · Documentation Quality5.7 / 10Adequate✓ Tool-verified

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

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

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

1 of 2 documentation facets pass in full; short on: F2 example. 36 document(s) read across 17 unit(s).

Documentation: no build, run or usage example · ×12js/gritql/npm/android-arm64/README.md:1

What to do

  1. Resolve the 12 Documentation finding(s) in Documentation Quality — start with README.md (12). — One of this dimension's main actionable groups (12 recommendation-level).

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

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

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

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

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

No architecture decision records were found.

No ADRs foundresources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj:3

What to do

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

D24 · Comment Value10.0 9.7 / 10Exemplary○ Nothing flagged

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

Maturity: Documented → Verified → Prevented · effective 9.7 / 10 · rule-coverage 97% · ceiling Documented

0 of 59 judged comments only repeat the code they sit on (0.0 %). 3 comment(s) in another language or script were not judged.

doc comments repeat the namescrates/cli_bin/fixtures/test_jsx.js:111

✓ On the Gold path — maintain.

Detailed fixes: d24_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.7 / 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.7 / 10 · rule-coverage 100% · ceiling Documented

16 finding(s): 0 critical, 9 high, 7 medium, 0 low. 1 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 7 file(s) — `crates/cli_bin/fixtures/concourse/foo.yaml`, `crates/cli_bin/fixtures/invalid_extensions/some_folder/file4.js.py` (line 1, line 2), `crates/cli_bin/fixtures/malformed.js` (line 1), `crates/cli_bin/fixtures/misc/many_problems.js` (line 2, line 3, line 6, …), `crates/cli_bin/fixtures/test_patterns/class_declaration/expected/class.js` (lines 1–3), … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

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

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

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

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

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

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

144 finding(s): 14 critical, 65 high, 63 medium, 2 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 65 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (34), REDACTED (26), REDACTED (5). — One of this dimension's main actionable groups (65 issue-level).
  2. Resolve the 14 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (7), REDACTED (6), REDACTED. — One of this dimension's main actionable groups (14 issue-level).
  3. Resolve the 24 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9), REDACTED (6), REDACTED (6). — One of this dimension's main actionable groups (24 warning-level).

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

D31 · IaC & Container Security10.0 / 10Exemplary○ Nothing flagged

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (Dockerfile/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

trivy and checkov found no infrastructure-as-code or container misconfigurations.

✓ On the Gold path — maintain.

Detailed fixes: d31_recommendation.md.

D34 · Knowledge Freshness0.1 / 10Critical✓ 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 0.1 / 10 · rule-coverage 100% · ceiling Documented

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

Orphaned file · ×179crates/language/src/target_language.rs:1
Most significant orphaned file · ×3crates/core/src/test.rs:1
Concentrated knowledge decay

What to do

  1. Resolve the 179 Orphaned file finding(s) in Knowledge Freshness — start with testing.rs (4), language.rs (3), patterns.rs (3). — One of this dimension's main actionable groups (179 recommendation-level).
  2. Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with test.rs, marzano_resolved_pattern.rs, resolver.rs. — One of this dimension's main actionable groups (3 recommendation-level).
  3. Resolve the 1 Concentrated knowledge decay finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).

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

D35 · Change Coupling9.9 / 10Stronggated by 3 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.9 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: apply_pattern.rs↔check.rs 67%; js_like.rs↔target_language.rs 54%; apply.rs↔plumbing.rs 50%

Change coupling: apply_pattern.rs ↔ check.rs · ×3crates/cli/src/commands/apply_pattern.rs:1

What to do

  1. Resolve the 3 Change coupling finding(s) in Change Coupling — start with apply_pattern.rs, js_like.rs, apply.rs. — One of this dimension's main actionable groups (3 warning-level).

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

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

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

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 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

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

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

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

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

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

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life2.0 / 10Critical✓ 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 2.0 / 10 · rule-coverage 100% · ceiling Documented

3 end-of-life runtime(s) and 0 end-of-life framework(s), read from 22 platform declaration(s) and 6 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.

End-of-life runtime: .NET net6.0 · ×3resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj:4

What to do

  1. Resolve the 3 End-of-life runtime finding(s) in Platform End-of-Life — start with Generator.csproj, REDACTED, rust-toolchain.toml. — One of this dimension's main actionable groups (3 warning-level).

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

Frontend & cross-cutting dimensions

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

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

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

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

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

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

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. 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.

DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.

Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.

Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.

DM5 · Encapsulated state10.0 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.

Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.

Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.

ES2 · Immutable events10.0 / 10Exemplary✓ Tool-verified

Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.

Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.

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

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

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

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

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

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

M2 · Architecture documentation5.0 / 10Adequate✓ Tool-verified

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

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

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

What to do

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

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

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

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

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

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

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

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

  • `prettier --version` invokes prettier in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:45

What to do

  • Add `--check` to the prettier step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language's code model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P2 · Observability8.2 / 10Strong✓ 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 9/12 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/cli_bin`, `docs`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
P3 · Security & performance tooling4.0 / 10Weak✓ 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.

  • `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:8

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

  • Make sure a person approves each release. The release job names an environment, but its approval rules live in the code host's settings, where we can't see them. Check that a reviewer must approve each release, or publish releases as drafts first, so a bad build can be stopped before anyone downloads 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.

PF3 · Async & latency hygiene8.5 / 10Strong✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `prep_query` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — js/gritql/src/search.rs:171

What to do

  • Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
X5 · Nullable reference types2.0 / 10Critical✓ Tool-verified

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

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

  • 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.

What to do

  • Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.

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 Health56%Adequate — gated by X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture99%ExemplarySolid.
Maturity70%Adequate — gated by D34Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness61%Adequate — gated by D12Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security65%Adequate — gated by D29, D44Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling100%ExemplaryStrongest area.
Event Sourcing100%ExemplarySolid.
Performance85%StrongSolid.
Unscored — 3 check(s) recorded observations but carry no score

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

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

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

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

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

  • AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
  • AX1 Captive dependencies — no DI registrations detected
  • AX2 Stateful singletons — no singleton implementations detected
  • AX6 Interface segregation — AX6 reached only 12% of this repository's production lines — rust (62,953 lines), python (156 lines), kotlin (8 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server (`npm run dev`) exited before it served a page. Likely cause (the repository): REDACTED has no "dev" script, so `npm run dev` could not start the app. Last output: "npm error Missing script: "dev" / npm error / npm error To see a list of scripts, run: / npm error npm run / npm error A complete log of this run can be found in: <path>" No runtime evidence was gathered. This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
  • C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
  • D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
  • D18 Solution Shape — D18 scores the shape of a .NET solution, but this repository's production source is mostly .c, .cts, .kt, .mts, .py, .rs, .ts, .tsx — the .NET project files present are an immaterial minority — so the dimension does not apply.
  • D21 Naming Consistency — Naming consistency does not read html yet; not measured.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed JavaScript, Rust surface was not measured.
  • D23 Boundary Type-Coupling — single shared-core project — no cross-context coupling to assess
  • D25 ADR Conformance — no ADRs to check
  • D26 Project Cohesion — This repository is one project, `Generator` (149 LoC, 0 public types across 0 namespaces), within the size bounds. Not scored: a single unit of this size gives project cohesion nothing to grade.
  • D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage NOT MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half could not be measured — the bun:test suite in js/gritql/ ran and not one test passed (error: Error: Failed to fetch standard library grit module getgrit/stdlib. Try running `grit init` first to create a local .grit directory.), so the coverage report describes the failed run, not the code. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
  • DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
  • DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
  • DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
  • ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
  • IC1 Incompleteness & stubs — reported, not scored — this repository's C# declares no analysable method bodies (a constants, record or DTO assembly), and this score is a density of unfinished work per method, which has no denominator here. The file-level signals below were still collected and are shown in full
  • 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 — this isn't a service/API/worker
  • P8 Schema migrations — no EF Core usage detected
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
  • X1 Async correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (62,953 lines), typescript (7,710 lines), javascript (1,070 lines), python (156 lines), kotlin (8 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X13 Undrained process stream — X13 reached only 0% of this repository's production lines — rust (62,953 lines), typescript (7,710 lines), javascript (1,070 lines), python (156 lines), kotlin (8 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — X16 reached only 0% of this repository's production lines — rust (62,953 lines), typescript (7,710 lines), javascript (1,070 lines), python (156 lines), kotlin (8 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X2 Cancellation propagation — no async method does work a token could cancel
  • X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X21 Side-effecting pattern guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — X27 reached only 0% of this repository's production lines — rust (62,953 lines), typescript (7,710 lines), javascript (1,070 lines), python (156 lines), kotlin (8 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • X28 Index access outside its own emptiness guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X3 Exception handling — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X32 Type resolved by simple name across every loaded assembly — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X4 Structured logging — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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 — 88 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×65
  • 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
  • + 40 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×14
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
Serious — 390 finding(s)
D30 · Dependency Vulnerabilities · Medium CVE · ×24
  • 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 · marzano_core · ×15
  • marzano_core::inline_snippets::get_deletion_indices (cognitive 113) crates/core/src/inline_snippets.rs:518 — marzano_core::inline_snippets::get_deletion_indices has cognitive complexity 113 (threshold 15). Drivers by points: if/else 29 (97 pts), boolean chains 10, match/switch 2 (5 pts), loops 1 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::inline_snippets::update_comma_insertion_strings (cognitive 64) crates/core/src/inline_snippets.rs:418 — marzano_core::inline_snippets::update_comma_insertion_strings has cognitive complexity 64 (threshold 15). Drivers by points: if/else 16 (47 pts), boolean chains 11, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::optimizer::hoist_text::extract_body_pattern (cognitive 37) crates/core/src/optimizer/hoist_text.rs:104 — marzano_core::optimizer::hoist_text::extract_body_pattern has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (36 pts), match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • marzano_core::inline_snippets::inline_sorted_snippets_with_offset (cognitive 33) crates/core/src/inline_snippets.rs:124 — marzano_core::inline_snippets::inline_sorted_snippets_with_offset has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (5 pts), boolean chains 4 (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.
  • marzano_core::smart_insert::calculate_padding (cognitive 31) crates/core/src/smart_insert.rs:4 — marzano_core::smart_insert::calculate_padding has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::optimizer::hoist_files::extract_filename_pattern (cognitive 27) crates/core/src/optimizer/hoist_files.rs:13 — marzano_core::optimizer::hoist_files::extract_filename_pattern has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • marzano_core::pattern_compiler::auto_wrap::auto_wrap_pattern (cognitive 24) crates/core/src/pattern_compiler/auto_wrap.rs:19 — marzano_core::pattern_compiler::auto_wrap::auto_wrap_pattern has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17 (23 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.
  • marzano_core::built_in_functions::distinct_fn (cognitive 21) crates/core/src/built_in_functions.rs:445 — marzano_core::built_in_functions::distinct_fn has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (6 pts), match/switch 2 (3 pts) (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • marzano_core::pattern_compiler::compiler::filter_libs (cognitive 21) crates/core/src/pattern_compiler/compiler.rs:570 — marzano_core::pattern_compiler::compiler::filter_libs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 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.
  • marzano_core::inline_snippets::filter_out_nested (cognitive 20) crates/core/src/inline_snippets.rs:11 — marzano_core::inline_snippets::filter_out_nested has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::analysis::get_dependents_of_target_patterns_by_traversal_from_src (cognitive 19) crates/core/src/analysis.rs:112 — marzano_core::analysis::get_dependents_of_target_patterns_by_traversal_from_src has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::inline_snippets::delete_hanging_comma (cognitive 19) crates/core/src/inline_snippets.rs:301 — marzano_core::inline_snippets::delete_hanging_comma has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::pattern_compiler::compiler::defs_to_filenames (cognitive 19) crates/core/src/pattern_compiler/compiler.rs:470 — marzano_core::pattern_compiler::compiler::defs_to_filenames has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::marzano_binding::linearize_binding (cognitive 17) crates/core/src/marzano_binding.rs:59 — marzano_core::marzano_binding::linearize_binding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_core::tree_sitter_serde::tree_sitter_node_to_json (cognitive 16) crates/core/src/tree_sitter_serde.rs:10 — marzano_core::tree_sitter_serde::tree_sitter_node_to_json has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities · Medium advisory (unsound) · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
SC1 · Supply-chain hygiene · JavaScript dependencies are not locked · ×15
  • JavaScript dependencies are not locked __generated__/grit-wasm-bindings/package.json:22 — __generated__/grit-wasm-bindings/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked js/gritql/package.json:27 — js/gritql/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-css/package.json:17 — resources/language-metavariables/tree-sitter-css/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-go/package.json:16 — resources/language-metavariables/tree-sitter-go/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-hcl/package.json:8 — resources/language-metavariables/tree-sitter-hcl/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-html/package.json:24 — resources/language-metavariables/tree-sitter-html/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-java/package.json:25 — resources/language-metavariables/tree-sitter-java/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-javascript/package.json:17 — resources/language-metavariables/tree-sitter-javascript/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-json/package.json:13 — resources/language-metavariables/tree-sitter-json/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/package.json:10 — resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/package.json:10 — resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-php/package.json:17 — resources/language-metavariables/tree-sitter-php/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-python/package.json:12 — resources/language-metavariables/tree-sitter-python/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-ruby/package.json:12 — resources/language-metavariables/tree-sitter-ruby/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
  • JavaScript dependencies are not locked resources/language-metavariables/tree-sitter-rust/package.json:16 — resources/language-metavariables/tree-sitter-rust/package.json declares dependencies that no committed lockfile resolves — there is no REDACTED / REDACTED / pnpm-lock.yaml / bun.lock beside it, and no locked workspace above it names it — so its installs aren't reproducible (SSDF PW.4.4). Commit its package manager's lockfile (or add it to the locked workspace) and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
D30 · Dependency Vulnerabilities · Medium advisory (unmaintained) · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FunctionTooLong · ×12
  • FunctionTooLong: marzano_cli::commands::apply_pattern::run_apply_pattern crates/cli/src/commands/apply_pattern.rs:200 — FunctionTooLong — marzano_cli::commands::apply_pattern::run_apply_pattern runs 282 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 182 over it, 2.82× 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: marzano_cli::commands::check::run_check crates/cli/src/commands/check.rs:76 — FunctionTooLong — marzano_cli::commands::check::run_check runs 250 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 150 over it, 2.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: marzano_cli::commands::plumbing::run_plumbing crates/cli/src/commands/plumbing.rs:129 — FunctionTooLong — marzano_cli::commands::plumbing::run_plumbing runs 213 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 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: marzano_lsp::testing::maybe_test_pattern crates/lsp/src/testing.rs:29 — FunctionTooLong — marzano_lsp::testing::maybe_test_pattern runs 145 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 45 over it, 1.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: marzano_gritmodule::markdown::get_patterns_from_md crates/gritmodule/src/markdown.rs:57 — FunctionTooLong — marzano_gritmodule::markdown::get_patterns_from_md runs 138 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: marzano_cli::analyze::par_apply_pattern crates/cli/src/analyze.rs:144 — FunctionTooLong — marzano_cli::analyze::par_apply_pattern 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.
  • FunctionTooLong: marzano_cli::workflows::run_bin_workflow crates/cli/src/workflows.rs:59 — FunctionTooLong — marzano_cli::workflows::run_bin_workflow 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.
  • FunctionTooLong: marzano_gritmodule::testing::test_pattern_sample crates/gritmodule/src/testing.rs:196 — FunctionTooLong — marzano_gritmodule::testing::test_pattern_sample 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.
  • FunctionTooLong: marzano_cli::commands::run_command crates/cli/src/commands/mod.rs:354 — FunctionTooLong — marzano_cli::commands::run_command runs 111 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: marzano_core::optimizer::hoist_text::extract_body_pattern crates/core/src/optimizer/hoist_text.rs:104 — FunctionTooLong — marzano_core::optimizer::hoist_text::extract_body_pattern 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.
  • FunctionTooLong: gritql_napi::search::search_internal js/gritql/src/search.rs:351 — FunctionTooLong — gritql_napi::search::search_internal runs 107 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 7 over it, 1.07× 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: marzano_gritmodule::formatting::format_temp_dir crates/gritmodule/src/formatting.rs:72 — FunctionTooLong — marzano_gritmodule::formatting::format_temp_dir 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.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×12
  • Duplicated block (7 lines × 2) crates/core/src/analysis.rs:144 — crates/core/src/analysis.rs:144-150 | crates/core/src/pattern_compiler/compiler.rs:603-609 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/analysis.rs:144` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/core/src/marzano_resolved_pattern.rs:666 — crates/core/src/marzano_resolved_pattern.rs:666-672 | crates/core/src/marzano_resolved_pattern.rs:804-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/marzano_resolved_pattern.rs:666` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/any_compiler.rs:20 — crates/core/src/pattern_compiler/any_compiler.rs:20-26 | crates/core/src/pattern_compiler/or_compiler.rs:20-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/any_compiler.rs:20` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/compiler.rs:484 — crates/core/src/pattern_compiler/compiler.rs:484-490 | crates/core/src/pattern_compiler/compiler.rs:492-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/compiler.rs:482 — crates/core/src/pattern_compiler/compiler.rs:482-488 | crates/core/src/pattern_compiler/compiler.rs:525-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/compiler.rs:482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/compiler.rs:527 — crates/core/src/pattern_compiler/compiler.rs:527-533 | crates/core/src/pattern_compiler/compiler.rs:535-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/if_compiler.rs:20 — crates/core/src/pattern_compiler/if_compiler.rs:20-26 | crates/core/src/pattern_compiler/if_compiler.rs:46-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2) crates/core/src/sdk/binding.rs:77 — crates/core/src/sdk/binding.rs:77-83 | js/gritql/src/binding.rs:29-35 — before extracting anything, compare `crates/core/src/sdk/binding.rs` and `js/gritql/src/binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/grit-pattern-matcher/src/pattern/iter_pattern.rs:79 — crates/grit-pattern-matcher/src/pattern/iter_pattern.rs:79-85 | crates/grit-pattern-matcher/src/pattern/iter_pattern.rs:87-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/grit-pattern-matcher/src/pattern/variable.rs:425 — crates/grit-pattern-matcher/src/pattern/variable.rs:425-431 | crates/grit-pattern-matcher/src/pattern/variable.rs:440-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/variable.rs:425` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) crates/cli/src/result_formatting.rs:510 — crates/cli/src/result_formatting.rs:510-516 | crates/cli/src/result_formatting.rs:519-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) crates/core/src/pattern_compiler/back_tick_compiler.rs:21 — crates/core/src/pattern_compiler/back_tick_compiler.rs:21-27 | crates/core/src/pattern_compiler/snippet_compiler.rs:63-69 — 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.
D30 · Dependency Vulnerabilities · Medium vulnerability · ×11
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D2 · Cognitive Complexity · marzano_cli · ×9
  • marzano_cli::commands::check::run_check (cognitive 80) crates/cli/src/commands/check.rs:76 — marzano_cli::commands::check::run_check has cognitive complexity 80 (threshold 15). Drivers by points: if/else 27 (42 pts), loops 10 (23 pts), match/switch 6 (12 pts), boolean chains 3 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_cli::commands::apply_pattern::run_apply_pattern (cognitive 70) crates/cli/src/commands/apply_pattern.rs:200 — marzano_cli::commands::apply_pattern::run_apply_pattern has cognitive complexity 70 (threshold 15). Drivers by points: if/else 35 (55 pts), match/switch 6 (10 pts), boolean chains 4, 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.
  • marzano_cli::analyze::par_apply_pattern (cognitive 54) crates/cli/src/analyze.rs:144 — marzano_cli::analyze::par_apply_pattern has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 4 (7 pts), match/switch 3 (4 pts), boolean chains 3 (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.
  • marzano_cli::lister::list_applyables (cognitive 49) crates/cli/src/lister.rs:113 — marzano_cli::lister::list_applyables has cognitive complexity 49 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 7 (18 pts), match/switch 3 (7 pts), boolean chains 2 (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.
  • marzano_cli::commands::patterns::run_patterns_describe (cognitive 33) crates/cli/src/commands/patterns.rs:68 — marzano_cli::commands::patterns::run_patterns_describe has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 2 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_cli::commands::plumbing::run_plumbing (cognitive 31) crates/cli/src/commands/plumbing.rs:129 — marzano_cli::commands::plumbing::run_plumbing has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 5 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • marzano_cli::commands::run_command (cognitive 23) crates/cli/src/commands/mod.rs:354 — marzano_cli::commands::run_command has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 8 (12 pts), if/else 8 (11 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.
  • marzano_cli::workflows::run_bin_workflow (cognitive 23) crates/cli/src/workflows.rs:59 — marzano_cli::workflows::run_bin_workflow has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_cli::workflows::find_workflow_file_from (cognitive 18) crates/cli/src/workflows.rs:400 — marzano_cli::workflows::find_workflow_file_from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · MethodTooLong · ×9
  • MethodTooLong: MarzanoContext.exec_step crates/core/src/marzano_context.rs:192 — MethodTooLong — exec_step runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Contains.execute crates/grit-pattern-matcher/src/pattern/contains.rs:93 — MethodTooLong — execute runs 130 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: MarzanoNotebookParser.parse_file_as_notebook crates/language/src/notebooks.rs:212 — MethodTooLong — parse_file_as_notebook runs 127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 27 over it, 1.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Pattern.children crates/grit-pattern-matcher/src/pattern/iter_pattern.rs:248 — MethodTooLong — children runs 124 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: GritServer.execute_command crates/lsp/src/server.rs:503 — MethodTooLong — execute_command runs 112 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: PatternCompiler.from_node_with_rhs crates/core/src/pattern_compiler/pattern_compiler.rs:173 — MethodTooLong — from_node_with_rhs runs 110 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 10 over it, 1.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Messager.handle_results_inner crates/marzano_messenger/src/emit.rs:96 — MethodTooLong — handle_results_inner 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.
  • MethodTooLong: MarzanoResolvedPattern.from_pattern crates/core/src/marzano_resolved_pattern.rs:494 — MethodTooLong — from_pattern runs 103 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 3 over it, 1.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: RewriteCompiler.from_node_with_rhs crates/core/src/pattern_compiler/rewrite_compiler.rs:17 — MethodTooLong — from_node_with_rhs runs 102 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D2 · Cognitive Complexity · marzano_gritmodule · ×8
  • marzano_gritmodule::formatting::format_temp_dir (cognitive 84) crates/gritmodule/src/formatting.rs:72 — marzano_gritmodule::formatting::format_temp_dir has cognitive complexity 84 (threshold 15). Drivers by points: if/else 32 (72 pts), loops 5 (10 pts), boolean chains 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_gritmodule::resolver::resolve_patterns (cognitive 57) crates/gritmodule/src/resolver.rs:276 — marzano_gritmodule::resolver::resolve_patterns has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 3 (14 pts), loops 4 (7 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • marzano_gritmodule::markdown::get_patterns_from_md (cognitive 49) crates/gritmodule/src/markdown.rs:57 — marzano_gritmodule::markdown::get_patterns_from_md has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (45 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_gritmodule::resolver::resolve_namespace_import (cognitive 44) crates/gritmodule/src/resolver.rs:449 — marzano_gritmodule::resolver::resolve_namespace_import has cognitive complexity 44 (threshold 15). Drivers by points: match/switch 4 (20 pts), if/else 5 (19 pts), loops 2 (4 pts), boolean chains 1 (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.
  • marzano_gritmodule::resolver::resolve_patterns_for_module (cognitive 30) crates/gritmodule/src/resolver.rs:582 — marzano_gritmodule::resolver::resolve_patterns_for_module has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2, match/switch 1 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • marzano_gritmodule::testing::test_pattern_sample (cognitive 28) crates/gritmodule/src/testing.rs:196 — marzano_gritmodule::testing::test_pattern_sample has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 3 (6 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_gritmodule::dot_grit::get_patterns_from_grit (cognitive 20) crates/gritmodule/src/dot_grit.rs:15 — marzano_gritmodule::dot_grit::get_patterns_from_grit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (9 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_gritmodule::resolver::dir_has_config (cognitive 20) crates/gritmodule/src/resolver.rs:151 — marzano_gritmodule::resolver::dir_has_config has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 10). 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×8
  • Duplicated block (10 lines × 2) crates/core/src/inline_snippets.rs:445 — crates/core/src/inline_snippets.rs:445-454 | crates/core/src/inline_snippets.rs:537-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/inline_snippets.rs:445` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/core/src/optimizer/hoist_files.rs:16 — crates/core/src/optimizer/hoist_files.rs:16-26 | crates/core/src/optimizer/hoist_text.rs:108-117 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/optimizer/hoist_files.rs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/core/src/pattern_compiler/step_compiler.rs:77 — crates/core/src/pattern_compiler/step_compiler.rs:77-86 | crates/core/src/pattern_compiler/step_compiler.rs:100-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (10 lines × 2) crates/grit-pattern-matcher/src/pattern/match.rs:59 — crates/grit-pattern-matcher/src/pattern/match.rs:59-68 | crates/grit-pattern-matcher/src/pattern/match.rs:71-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/match.rs:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/grit-pattern-matcher/src/pattern/match.rs:95 — crates/grit-pattern-matcher/src/pattern/match.rs:95-104 | crates/grit-pattern-matcher/src/pattern/match.rs:108-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/match.rs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/language/src/css.rs:126 — crates/language/src/css.rs:126-135 | crates/language/src/js_like.rs:133-142 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/language/src/css.rs:126` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) crates/language/src/markdown_block.rs:37 — crates/language/src/markdown_block.rs:37-46 | crates/language/src/markdown_inline.rs:31-40 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (10 lines × 2) crates/core/src/pattern_compiler/as_compiler.rs:39 — crates/core/src/pattern_compiler/as_compiler.rs:39-49 | crates/core/src/pattern_compiler/regex_compiler.rs:58-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/as_compiler.rs:39` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D3 · God Classes · FileTooLong · ×7
  • FileTooLong: src/marzano_resolved_pattern.rs crates/core/src/marzano_resolved_pattern.rs — FileTooLong — 709 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 89% of them inside a single declaration: MarzanoResolvedPattern (3 blocks, 30-884). The bar is 500 significant lines; this is 209 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: src/target_language.rs crates/language/src/target_language.rs — FileTooLong — 622 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 122 over it, 1.24× 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/api.rs crates/core/src/api.rs — FileTooLong — 591 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 91 over it, 1.18× 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: pattern_compiler/compiler.rs crates/core/src/pattern_compiler/compiler.rs — FileTooLong — 560 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 60 over it, 1.12× 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/resolver.rs crates/gritmodule/src/resolver.rs — FileTooLong — 549 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 49 over it, 1.10× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: commands/mod.rs crates/cli/src/commands/mod.rs — FileTooLong — 509 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 9 over it, 1.02× 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/server.rs crates/lsp/src/server.rs — FileTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: GritServer (3 blocks, 44-668). The bar is 500 significant lines; this is 5 over it, 1.01× 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.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) crates/core/src/marzano_resolved_pattern.rs:468 — crates/core/src/marzano_resolved_pattern.rs:468-476 | crates/core/src/marzano_resolved_pattern.rs:484-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) crates/core/src/pattern_compiler/accumulate_compiler.rs:43 — crates/core/src/pattern_compiler/accumulate_compiler.rs:43-51 | crates/grit-pattern-matcher/src/pattern/includes.rs:71-79 — before extracting anything, compare `crates/core/src/pattern_compiler/accumulate_compiler.rs` and `crates/grit-pattern-matcher/src/pattern/includes.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/accumulate_compiler.rs:42` calls `Regex` and `crates/grit-pattern-matcher/src/pattern/includes.rs:70` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/core/src/pattern_compiler/auto_wrap.rs:88 — crates/core/src/pattern_compiler/auto_wrap.rs:88-96 | crates/core/src/pattern_compiler/auto_wrap.rs:154-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/auto_wrap.rs:88` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:97` calls `File` and `crates/core/src/pattern_compiler/auto_wrap.rs:163` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/core/src/pattern_compiler/auto_wrap.rs:158 — crates/core/src/pattern_compiler/auto_wrap.rs:158-166 | crates/core/src/pattern_compiler/auto_wrap.rs:252-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:167` calls `CallbackPattern` and `crates/core/src/pattern_compiler/auto_wrap.rs:261` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) crates/grit-pattern-matcher/src/pattern/range.rs:45 — crates/grit-pattern-matcher/src/pattern/range.rs:45-53 | crates/grit-pattern-matcher/src/pattern/range.rs:55-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (9 lines × 2) crates/lsp/src/server.rs:530 — crates/lsp/src/server.rs:530-538 | crates/lsp/src/server.rs:612-620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (9 lines × 2) crates/cli/src/workflows.rs:184 — crates/cli/src/workflows.rs:184-192 | crates/cli/src/workflows.rs:201-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/workflows.rs:184` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×7
  • Duplicated block (6 lines × 2) crates/cli/src/result_formatting.rs:291 — crates/cli/src/result_formatting.rs:291-296 | crates/cli/src/result_formatting.rs:298-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (6 lines × 2) crates/core/src/pattern_compiler/compiler.rs:491 — crates/core/src/pattern_compiler/compiler.rs:491-496 | crates/core/src/pattern_compiler/compiler.rs:534-539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/compiler.rs:491` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/core/src/pattern_compiler/compiler.rs:500 — crates/core/src/pattern_compiler/compiler.rs:500-505 | crates/core/src/pattern_compiler/compiler.rs:507-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.
  • Duplicated block (6 lines × 2) crates/core/src/pattern_compiler/compiler.rs:499 — crates/core/src/pattern_compiler/compiler.rs:499-504 | crates/core/src/pattern_compiler/compiler.rs:542-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/compiler.rs:499` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/core/src/pattern_compiler/compiler.rs:506 — crates/core/src/pattern_compiler/compiler.rs:506-511 | crates/core/src/pattern_compiler/compiler.rs:549-554 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/compiler.rs:506` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (6 lines × 2) crates/core/src/sdk/binding.rs:47 — crates/core/src/sdk/binding.rs:47-52 | js/gritql/src/search.rs:228-233 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
  • Duplicated block (6 lines × 2) crates/language/src/java.rs:38 — crates/language/src/java.rs:38-43 | crates/language/src/rust.rs:38-43 — 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.
D1 · Cyclomatic Complexity · marzano_cli · ×6
  • marzano_cli::commands::check::run_check (cyclomatic 44) crates/cli/src/commands/check.rs:76 — marzano_cli::commands::check::run_check 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.
  • marzano_cli::commands::run_command (cyclomatic 39) crates/cli/src/commands/mod.rs:354 — marzano_cli::commands::run_command has cyclomatic complexity 39 (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.
  • marzano_cli::commands::apply_pattern::run_apply_pattern (cyclomatic 39) crates/cli/src/commands/apply_pattern.rs:200 — marzano_cli::commands::apply_pattern::run_apply_pattern has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_cli::analyze::par_apply_pattern (cyclomatic 27) crates/cli/src/analyze.rs:144 — marzano_cli::analyze::par_apply_pattern has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_cli::lister::list_applyables (cyclomatic 24) crates/cli/src/lister.rs:113 — marzano_cli::lister::list_applyables 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.
  • marzano_cli::commands::plumbing::run_plumbing (cyclomatic 20) crates/cli/src/commands/plumbing.rs:129 — marzano_cli::commands::plumbing::run_plumbing has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×6
  • Edited copy of a member (11 corresponding lines) crates/core/src/pattern_compiler/back_tick_compiler.rs:20 — crates/core/src/pattern_compiler/back_tick_compiler.rs:20-30 | crates/core/src/pattern_compiler/back_tick_compiler.rs:42-56 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/grit-pattern-matcher/src/pattern/variable.rs:421 — crates/grit-pattern-matcher/src/pattern/variable.rs:421-431 | crates/grit-pattern-matcher/src/pattern/variable.rs:436-446 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/core/src/pattern_compiler/contains_compiler.rs:19 — crates/core/src/pattern_compiler/contains_compiler.rs:19-29 | crates/core/src/pattern_compiler/within_compiler.rs:19-30 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/core/src/problem.rs:322 — crates/core/src/problem.rs:322-332 | crates/core/src/problem.rs:378-388 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/grit-pattern-matcher/src/pattern/container.rs:72 — crates/grit-pattern-matcher/src/pattern/container.rs:72-82 | crates/grit-pattern-matcher/src/pattern/container.rs:88-98 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) crates/core/src/optimizer/hoist_files.rs:159 — crates/core/src/optimizer/hoist_files.rs:159-169 | crates/core/src/optimizer/hoist_text.rs:270-282 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D1 · Cyclomatic Complexity · marzano_core · ×5
  • marzano_core::inline_snippets::get_deletion_indices (cyclomatic 51) crates/core/src/inline_snippets.rs:518 — marzano_core::inline_snippets::get_deletion_indices has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_core::optimizer::hoist_text::extract_body_pattern (cyclomatic 39) crates/core/src/optimizer/hoist_text.rs:104 — marzano_core::optimizer::hoist_text::extract_body_pattern has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_core::inline_snippets::update_comma_insertion_strings (cyclomatic 38) crates/core/src/inline_snippets.rs:418 — marzano_core::inline_snippets::update_comma_insertion_strings has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_core::optimizer::hoist_files::extract_filename_pattern (cyclomatic 35) crates/core/src/optimizer/hoist_files.rs:13 — marzano_core::optimizer::hoist_files::extract_filename_pattern has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_core::inline_snippets::inline_sorted_snippets_with_offset (cyclomatic 19) crates/core/src/inline_snippets.rs:124 — marzano_core::inline_snippets::inline_sorted_snippets_with_offset 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.
D1 · Cyclomatic Complexity · marzano_gritmodule · ×4
  • marzano_gritmodule::formatting::format_temp_dir (cyclomatic 35) crates/gritmodule/src/formatting.rs:72 — marzano_gritmodule::formatting::format_temp_dir has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_gritmodule::markdown::get_patterns_from_md (cyclomatic 29) crates/gritmodule/src/markdown.rs:57 — marzano_gritmodule::markdown::get_patterns_from_md 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.
  • marzano_gritmodule::testing::test_pattern_sample (cyclomatic 21) crates/gritmodule/src/testing.rs:196 — marzano_gritmodule::testing::test_pattern_sample 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.
  • marzano_gritmodule::resolver::resolve_patterns (cyclomatic 18) crates/gritmodule/src/resolver.rs:276 — marzano_gritmodule::resolver::resolve_patterns has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D29 · Static Analysis (SAST) · REDACTED · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×4
  • Duplicated block (15 lines × 2) crates/core/src/marzano_resolved_pattern.rs:427 — crates/core/src/marzano_resolved_pattern.rs:427-441 | crates/core/src/marzano_resolved_pattern.rs:521-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/marzano_resolved_pattern.rs:427` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/core/src/optimizer/hoist_files.rs:256 — crates/core/src/optimizer/hoist_files.rs:256-270 | crates/core/src/optimizer/hoist_text.rs:370-384 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/optimizer/hoist_files.rs:256` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/core/src/optimizer/hoist_files.rs:278 — crates/core/src/optimizer/hoist_files.rs:278-292 | crates/core/src/optimizer/hoist_text.rs:392-406 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/optimizer/hoist_files.rs:278` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) crates/grit-pattern-matcher/src/errors.rs:16 — crates/grit-pattern-matcher/src/errors.rs:16-30 | crates/grit-pattern-matcher/src/errors.rs:38-52 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×4
  • Duplicated block (11 lines × 2) crates/core/src/inline_snippets.rs:458 — crates/core/src/inline_snippets.rs:458-468 | crates/core/src/inline_snippets.rs:555-565 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/inline_snippets.rs:458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) crates/grit-pattern-matcher/src/pattern/accessor.rs:150 — crates/grit-pattern-matcher/src/pattern/accessor.rs:150-160 | crates/grit-pattern-matcher/src/pattern/list_index.rs:190-200 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (11 lines × 2) crates/gritmodule/src/resolver.rs:57 — crates/gritmodule/src/resolver.rs:57-67 | crates/gritmodule/src/resolver.rs:329-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/gritmodule/src/resolver.rs:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/gritmodule/src/resolver.rs:341` calls `entry`, `or_insert_with` and `crates/gritmodule/src/resolver.rs:68` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) crates/auth/src/auth0.rs:120 — crates/auth/src/auth0.rs:120-130 | crates/auth/src/auth0.rs:163-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/auth/src/auth0.rs:120` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×4
  • Duplicated block (8 lines × 2) crates/cli/src/lister.rs:197 — crates/cli/src/lister.rs:197-204 | crates/cli/src/lister.rs:212-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/lister.rs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/grit-pattern-matcher/src/pattern/after.rs:68 — crates/grit-pattern-matcher/src/pattern/after.rs:68-75 | crates/grit-pattern-matcher/src/pattern/before.rs:67-74 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) crates/wasm-bindings/src/match_pattern.rs:195 — crates/wasm-bindings/src/match_pattern.rs:195-202 | crates/wasm-bindings/src/match_pattern.rs:310-317 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/wasm-bindings/src/match_pattern.rs:195` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 2) crates/core/src/sdk/binding.rs:116 — crates/core/src/sdk/binding.rs:116-123 | js/gritql/src/binding.rs:90-97 — before extracting anything, compare `crates/core/src/sdk/binding.rs` and `js/gritql/src/binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D12 · Dependency Hygiene · Dependency pinned to a stale untagged commit · ×3
  • Dependency pinned to a stale untagged commit: github.com/smacker/go-tree-sitter — Direct dependency `github.com/smacker/go-tree-sitter` is required at `v0.0.0-20230720070738-0d0a9f78d8f8` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-20, 3.3 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/smacker/go-tree-sitter` and has not moved this requirement in 3.3 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/smacker/go-tree-sitter` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/smacker/go-tree-sitter — Direct dependency `github.com/smacker/go-tree-sitter` is required at `v0.0.0-20230720070738-0d0a9f78d8f8` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-20, 3.3 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/smacker/go-tree-sitter` and has not moved this requirement in 3.3 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/smacker/go-tree-sitter` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
  • Dependency pinned to a stale untagged commit: github.com/smacker/go-tree-sitter — Direct dependency `github.com/smacker/go-tree-sitter` is required at `v0.0.0-20230720070738-0d0a9f78d8f8` in REDACTED — a pseudo-version, which pins an UNTAGGED commit from 2023-07-20, 3.3 years ago. The pin itself is exact, so this is not a reproducibility defect, and it is not a claim that the module is unmaintained. What it says is that this repository tracks no RELEASE of `github.com/smacker/go-tree-sitter` and has not moved this requirement in 3.3 years: every fix the module has published since that commit — including any security fix — is absent from this build, whether the module went quiet or moved on without you. Check whether `github.com/smacker/go-tree-sitter` now publishes tagged releases and move the requirement to one; if it publishes none, re-pin to a current commit.
D2 · Cognitive Complexity · grit_pattern_matcher · ×3
  • grit_pattern_matcher::pattern::list::execute_assoc (cognitive 39) crates/grit-pattern-matcher/src/pattern/list.rs:57 — grit_pattern_matcher::pattern::list::execute_assoc has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 18). 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.
  • grit_pattern_matcher::pattern::contains::execute_until (cognitive 20) crates/grit-pattern-matcher/src/pattern/contains.rs:37 — grit_pattern_matcher::pattern::contains::execute_until has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • grit_pattern_matcher::pattern::includes::execute (cognitive 19) crates/grit-pattern-matcher/src/pattern/includes.rs:30 — grit_pattern_matcher::pattern::includes::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D35 · Change Coupling · Change coupling · ×3
  • Change coupling: apply_pattern.rs ↔ check.rs crates/cli/src/commands/apply_pattern.rs:1 — `crates/cli/src/commands/apply_pattern.rs` and `crates/cli/src/commands/check.rs` change together 67% of the time (8 of the 12 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `f9fa65f9` feat: add utilities for streaming paths (#387); `c879bde0` feat: init gritql python (#337); `44ae5050` feat: apply transforms on stdin (#320) — run `git show` on any of them.
  • Change coupling: js_like.rs ↔ target_language.rs crates/language/src/js_like.rs:1 — `crates/language/src/js_like.rs` and `crates/language/src/target_language.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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `3772e3ce` chore: move `alternate_metavariable_kinds` around (#314); `cbe4afc7` chore: handle skipping uniformly (#283); `13265d75` fix: improve member_expression matching in JavaScript (#282) — run `git show` on any of them.
  • Change coupling: apply.rs ↔ plumbing.rs crates/cli/src/commands/apply.rs:1 — `crates/cli/src/commands/apply.rs` and `crates/cli/src/commands/plumbing.rs` change together 50% of the time (8 of the 16 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise 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 `6dd18426` feat: emit workflow errors earlier (#502); `83154ca1` feat: switch --remote workflows to reuse an existing ID (#497); `8a83b0f5` feat: Add workflow upload to cli (#493) — run `git show` on any of them.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×3
  • Edited copy of a member (13 corresponding lines) crates/grit-pattern-matcher/src/pattern/variable.rs:215 — crates/grit-pattern-matcher/src/pattern/variable.rs:215-227 | crates/grit-pattern-matcher/src/pattern/variable.rs:231-243 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/core/src/fs.rs:54 — crates/core/src/fs.rs:54-66 | crates/gritmodule/src/utils.rs:11-23 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) crates/core/src/foreign_function_definition.rs:142 — crates/core/src/foreign_function_definition.rs:142-154 | crates/grit-pattern-matcher/src/pattern/functions.rs:55-67 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) crates/core/src/smart_insert.rs:79 — crates/core/src/smart_insert.rs:79-90 | crates/core/src/smart_insert.rs:92-105 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/grit-pattern-matcher/src/pattern/state.rs:398 — crates/grit-pattern-matcher/src/pattern/state.rs:398-409 | crates/grit-pattern-matcher/src/pattern/state.rs:411-422 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) crates/grit-pattern-matcher/src/pattern/state.rs:71 — crates/grit-pattern-matcher/src/pattern/state.rs:71-82 | crates/grit-pattern-matcher/src/pattern/state.rs:84-95 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×3
  • Edited copy of a member (8 corresponding lines) crates/core/src/pattern_compiler/compiler.rs:685 — crates/core/src/pattern_compiler/compiler.rs:685-692 | crates/core/src/pattern_compiler/compiler.rs:695-703 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/core/src/sdk/binding.rs:76 — crates/core/src/sdk/binding.rs:76-83 | js/gritql/src/binding.rs:28-35 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) crates/grit-pattern-matcher/src/pattern/and.rs:34 — crates/grit-pattern-matcher/src/pattern/and.rs:34-41 | crates/grit-pattern-matcher/src/pattern/sequential.rs:20-27 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (8 lines × 4) · ×3
  • Duplicated block (8 lines × 4) crates/core/src/optimizer/hoist_files.rs:320 — crates/core/src/optimizer/hoist_files.rs:320-327 | crates/core/src/optimizer/hoist_text.rs:59-66 | crates/core/src/pattern_compiler/auto_wrap.rs:99-106 | crates/core/src/pattern_compiler/auto_wrap.rs:164-171 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/optimizer/hoist_files.rs:328` calls `Maybe` and `crates/core/src/pattern_compiler/auto_wrap.rs:172` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8 lines × 4) crates/core/src/sdk/binding.rs:101 — crates/core/src/sdk/binding.rs:101-108 | crates/core/src/sdk/binding.rs:149-156 | js/gritql/src/binding.rs:56-63 | js/gritql/src/binding.rs:76-83 — before extracting anything, compare `crates/core/src/sdk/binding.rs` and `js/gritql/src/binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/sdk/binding.rs:101` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (8 lines × 4) crates/gritmodule/src/formatting.rs:86 — crates/gritmodule/src/formatting.rs:86-93 | crates/gritmodule/src/formatting.rs:108-115 | crates/gritmodule/src/formatting.rs:129-136 | crates/gritmodule/src/formatting.rs:151-158 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/gritmodule/src/formatting.rs:86` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×3
  • Duplicated block (5 lines × 2) crates/cli/src/commands/parse.rs:97 — crates/cli/src/commands/parse.rs:97-101 | crates/wasm-bindings/src/match_pattern.rs:321-325 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/commands/parse.rs:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (5 lines × 2) crates/core/src/pattern_compiler/ast_node_compiler.rs:118 — crates/core/src/pattern_compiler/ast_node_compiler.rs:118-122 | crates/core/src/sdk/compiler.rs:110-116 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/ast_node_compiler.rs:118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) crates/grit-pattern-matcher/src/pattern/float_constant.rs:33 — crates/grit-pattern-matcher/src/pattern/float_constant.rs:33-37 | crates/grit-pattern-matcher/src/pattern/int_constant.rs:33-37 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/float_constant.rs:33` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D44 · Platform End-of-Life · End-of-life runtime · ×3
  • End-of-life runtime: .NET net6.0 resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj:4 — resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj declares .NET net6.0 as this project's target framework, and .NET 6 LTS, support ended 2024-11-12. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2024-11-12 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
  • End-of-life runtime: Node.js 10 js/gritql/package.json:45 — js/gritql/package.json declares Node.js 10 as this project's engines.node, and Node.js 10, support ended 2021-04-30. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2021-04-30 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
  • End-of-life runtime: Rust 1.82 rust-toolchain.toml:1 — rust-toolchain.toml declares Rust 1.82 as this project's toolchain file, and Rust 1.82, superseded by 1.83 on 2024-11-28 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2024-11-28 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
D1 · Cyclomatic Complexity · Predicate · ×2
  • Predicate::extract_body_pattern (cyclomatic 25) crates/core/src/optimizer/hoist_text.rs:317 — Predicate::extract_body_pattern has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • Predicate::extract_filename_pattern (cyclomatic 23) crates/core/src/optimizer/hoist_files.rs:205 — Predicate::extract_filename_pattern 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 · marzano_language · ×2
  • marzano_language::js_like::jslike_check_replacements (cyclomatic 20) crates/language/src/js_like.rs:170 — marzano_language::js_like::jslike_check_replacements has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • marzano_language::language::snippet_nodes_from_index (cyclomatic 16) crates/language/src/language.rs:564 — marzano_language::language::snippet_nodes_from_index 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.
D2 · Cognitive Complexity · marzano_util · ×2
  • marzano_util::diff::parse_modified_ranges (cognitive 40) crates/util/src/diff.rs:70 — marzano_util::diff::parse_modified_ranges has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (37 pts), boolean chains 2, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • marzano_util::diff_standardizer::standardize_rewrite (cognitive 26) crates/util/src/diff_standardizer.rs:13 — marzano_util::diff_standardizer::standardize_rewrite has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (7 pts), match/switch 2 (6 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Predicate · ×2
  • Predicate::extract_body_pattern (cognitive 37) crates/core/src/optimizer/hoist_text.rs:317 — Predicate::extract_body_pattern has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
  • Predicate::extract_filename_pattern (cognitive 31) crates/core/src/optimizer/hoist_files.rs:205 — Predicate::extract_filename_pattern has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 2 (3 pts) (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · marzano_language · ×2
  • marzano_language::js_like::jslike_check_replacements (cognitive 37) crates/language/src/js_like.rs:170 — marzano_language::js_like::jslike_check_replacements has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 18). 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.
  • marzano_language::language::snippet_nodes_from_index (cognitive 27) crates/language/src/language.rs:564 — marzano_language::language::snippet_nodes_from_index has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, loops 3 (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.
D2 · Cognitive Complexity · marzano_lsp · ×2
  • marzano_lsp::scan::collect_initial_diagnostics (cognitive 21) crates/lsp/src/scan.rs:36 — marzano_lsp::scan::collect_initial_diagnostics has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 4 (7 pts), loops 2 (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.
  • marzano_lsp::testing::maybe_test_pattern (cognitive 16) crates/lsp/src/testing.rs:29 — marzano_lsp::testing::maybe_test_pattern has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5, loops 2 (3 pts) (nesting depth added 4). 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.
D3 · God Classes · ClassTooLong · ×2
  • ClassTooLong: MarzanoResolvedPattern crates/core/src/marzano_resolved_pattern.rs:30 — ClassTooLong — 634 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 30-884. The bar is 400 significant lines; this is 234 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: GritServer crates/lsp/src/server.rs:44 — ClassTooLong — 453 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 4 methods, 3 blocks, lines 44-668. The bar is 400 significant lines; this is 53 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D36 · Supply-chain Provenance & Signing · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/core/src/pattern_compiler/function_definition_compiler.rs:24 — crates/core/src/pattern_compiler/function_definition_compiler.rs:24-55 | crates/core/src/pattern_compiler/function_definition_compiler.rs:67-103 | crates/core/src/pattern_compiler/pattern_definition_compiler.rs:20-47 | crates/core/src/pattern_compiler/predicate_definition_compiler.rs:20-52 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) crates/core/src/sdk/binding.rs:94 — crates/core/src/sdk/binding.rs:94-110 | crates/core/src/sdk/binding.rs:139-159 | js/gritql/src/binding.rs:46-65 | js/gritql/src/binding.rs:69-85 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) crates/core/src/pattern_compiler/compiler.rs:237 — crates/core/src/pattern_compiler/compiler.rs:237-256 | crates/core/src/pattern_compiler/compiler.rs:342-371 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) crates/grit-pattern-matcher/src/pattern/after.rs:32 — crates/grit-pattern-matcher/src/pattern/after.rs:32-51 | crates/grit-pattern-matcher/src/pattern/before.rs:31-50 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) crates/core/src/marzano_binding.rs:246 — crates/core/src/marzano_binding.rs:246-264 | crates/core/src/marzano_binding.rs:267-288 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) crates/language/src/css.rs:115 — crates/language/src/css.rs:115-135 | crates/language/src/js_like.rs:124-142 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×2
  • Edited copy of a member (18 corresponding lines) crates/cli/src/messenger_variant.rs:146 — crates/cli/src/messenger_variant.rs:146-166 | crates/cli/src/messenger_variant.rs:171-188 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (18 corresponding lines) crates/grit-pattern-matcher/src/pattern/any.rs:38 — crates/grit-pattern-matcher/src/pattern/any.rs:38-55 | crates/grit-pattern-matcher/src/pattern/any.rs:80-106 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) · ×2
  • Edited copies of one member (6 members, 11+ corresponding lines) crates/core/src/pattern_compiler/add_compiler.rs:19 — crates/core/src/pattern_compiler/add_compiler.rs:19-31 | crates/core/src/pattern_compiler/divide_compiler.rs:19-31 | crates/core/src/pattern_compiler/match_compiler.rs:19-29 | crates/core/src/pattern_compiler/modulo_compiler.rs:19-31 | crates/core/src/pattern_compiler/multiply_compiler.rs:19-31 | crates/core/src/pattern_compiler/subtract_compiler.rs:19-31 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
  • Edited copies of one member (6 members, 11+ corresponding lines) crates/core/src/pattern_compiler/and_compiler.rs:19 — crates/core/src/pattern_compiler/and_compiler.rs:19-30 | crates/core/src/pattern_compiler/and_compiler.rs:42-52 | crates/core/src/pattern_compiler/any_compiler.rs:19-29 | crates/core/src/pattern_compiler/any_compiler.rs:41-51 | crates/core/src/pattern_compiler/or_compiler.rs:19-29 | crates/core/src/pattern_compiler/or_compiler.rs:41-51 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) crates/core/src/optimizer/hoist_files.rs:315 — crates/core/src/optimizer/hoist_files.rs:315-331 | crates/core/src/optimizer/hoist_text.rs:54-70 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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) crates/core/src/pattern_compiler/not_compiler.rs:29 — crates/core/src/pattern_compiler/not_compiler.rs:29-45 | crates/core/src/pattern_compiler/not_compiler.rs:65-81 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication · Duplicated block (16 lines × 2) · ×2
  • Duplicated block (16 lines × 2) crates/core/src/pattern_compiler/ast_node_compiler.rs:75 — crates/core/src/pattern_compiler/ast_node_compiler.rs:75-90 | crates/core/src/sdk/compiler.rs:88-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/ast_node_compiler.rs:75` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (16 lines × 2) crates/core/src/sdk/binding.rs:95 — crates/core/src/sdk/binding.rs:95-110 | js/gritql/src/binding.rs:70-85 — before extracting anything, compare `crates/core/src/sdk/binding.rs` and `js/gritql/src/binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (12 lines × 4) · ×2
  • Duplicated block (12 lines × 4) crates/core/src/optimizer/hoist_text.rs:80 — crates/core/src/optimizer/hoist_text.rs:80-91 | crates/core/src/pattern_compiler/accumulate_compiler.rs:68-79 | crates/core/src/pattern_compiler/rewrite_compiler.rs:102-113 | crates/grit-pattern-matcher/src/pattern/includes.rs:95-106 — before extracting anything, compare `crates/core/src/optimizer/hoist_text.rs` and `crates/core/src/pattern_compiler/accumulate_compiler.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/optimizer/hoist_text.rs:78` calls `Dynamic`, `Variable` and `crates/core/src/pattern_compiler/rewrite_compiler.rs:101` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 4) crates/core/src/pattern_compiler/auto_wrap.rs:124 — crates/core/src/pattern_compiler/auto_wrap.rs:124-135 | crates/core/src/pattern_compiler/auto_wrap.rs:188-199 | crates/core/src/pattern_compiler/auto_wrap.rs:281-292 | crates/core/src/pattern_compiler/auto_wrap.rs:355-366 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:123` calls `Contains` and `crates/core/src/pattern_compiler/auto_wrap.rs:187` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10–11 lines × 2) · ×2
  • Duplicated block (10–11 lines × 2) crates/core/src/pattern_compiler/function_definition_compiler.rs:25 — crates/core/src/pattern_compiler/function_definition_compiler.rs:25-35 | crates/core/src/pattern_compiler/function_definition_compiler.rs:68-77 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/function_definition_compiler.rs:25` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10–11 lines × 2) crates/grit-pattern-matcher/src/pattern/variable.rs:290 — crates/grit-pattern-matcher/src/pattern/variable.rs:290-299 | crates/grit-pattern-matcher/src/pattern/variable.rs:378-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/variable.rs:290` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8–9 lines × 5) · ×2
  • Duplicated block (8–9 lines × 5) crates/core/src/optimizer/hoist_files.rs:117 — crates/core/src/optimizer/hoist_files.rs:117-124 | crates/core/src/optimizer/hoist_files.rs:309-317 | crates/core/src/optimizer/hoist_text.rs:48-56 | crates/core/src/optimizer/hoist_text.rs:228-235 | crates/core/src/pattern_compiler/accumulate_compiler.rs:36-44 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/optimizer/hoist_files.rs:318` calls `Bubble` and `crates/core/src/optimizer/hoist_files.rs:125` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (8–9 lines × 5) crates/core/src/pattern_compiler/auto_wrap.rs:128 — crates/core/src/pattern_compiler/auto_wrap.rs:128-135 | crates/core/src/pattern_compiler/auto_wrap.rs:192-199 | crates/core/src/pattern_compiler/auto_wrap.rs:285-292 | crates/core/src/pattern_compiler/auto_wrap.rs:359-366 | crates/core/src/pattern_compiler/rewrite_compiler.rs:110-118 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/rewrite_compiler.rs:109` calls `Where` and `crates/core/src/pattern_compiler/auto_wrap.rs:127` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8 lines × 5) · ×2
  • Duplicated block (8 lines × 5) crates/core/src/optimizer/hoist_files.rs:67 — crates/core/src/optimizer/hoist_files.rs:67-74 | crates/core/src/optimizer/hoist_files.rs:76-83 | crates/core/src/optimizer/hoist_files.rs:85-92 | crates/core/src/optimizer/hoist_files.rs:94-101 | crates/core/src/optimizer/hoist_files.rs:103-110 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (8 lines × 5) crates/core/src/optimizer/hoist_text.rs:178 — crates/core/src/optimizer/hoist_text.rs:178-185 | crates/core/src/optimizer/hoist_text.rs:187-194 | crates/core/src/optimizer/hoist_text.rs:196-203 | crates/core/src/optimizer/hoist_text.rs:205-212 | crates/core/src/optimizer/hoist_text.rs:214-221 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D5 · Coupling · Off the main sequence · ×2
  • Off the main sequence: grit-util — grit-util: abstractness 0.22, instability 0.00, distance 0.78 — zone of pain — concrete and depended on by 10 project(s), so it's rigid to change.
  • Off the main sequence: marzano-language — marzano-language: abstractness 0.05, instability 0.22, distance 0.73 — zone of pain — concrete and depended on by 7 project(s), so it's rigid to change.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: TransformedMessenger (LCOM4 6) crates/cli/src/result_formatting.rs:458 — TransformedMessenger's methods fall into 6 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 6 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: UncompiledPatternBuilder (LCOM4 4) crates/core/src/sdk/pattern_sdk.rs:68 — UncompiledPatternBuilder's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
D1 · Cyclomatic Complexity · PatternLanguage · ×1
  • PatternLanguage::from_string (cyclomatic 37) crates/language/src/target_language.rs:218 — PatternLanguage::from_string has cyclomatic complexity 37 (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 · Contains · ×1
  • Contains::execute (cyclomatic 28) crates/grit-pattern-matcher/src/pattern/contains.rs:93 — Contains::execute has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Commands · ×1
  • Commands::fmt (cyclomatic 27) crates/cli/src/commands/mod.rs:188 — Commands::fmt 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 · Messager · ×1
  • Messager::handle_results_inner (cyclomatic 26) crates/marzano_messenger/src/emit.rs:96 — Messager::handle_results_inner has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · FormattedResult · ×1
  • FormattedResult::fmt (cyclomatic 25) crates/cli/src/result_formatting.rs:184 — FormattedResult::fmt has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · GritServer · ×1
  • GritServer::execute_command (cyclomatic 25) crates/lsp/src/server.rs:503 — GritServer::execute_command has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarzanoNotebookParser · ×1
  • MarzanoNotebookParser::parse_file_as_notebook (cyclomatic 22) crates/language/src/notebooks.rs:212 — MarzanoNotebookParser::parse_file_as_notebook has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Python · ×1
  • Python::check_replacements (cyclomatic 21) crates/language/src/python.rs:80 — Python::check_replacements 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.
D1 · Cyclomatic Complexity · gritql_napi · ×1
  • gritql_napi::search::search_internal (cyclomatic 21) js/gritql/src/search.rs:351 — gritql_napi::search::search_internal 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.
D1 · Cyclomatic Complexity · grit_pattern_matcher · ×1
  • grit_pattern_matcher::pattern::list::execute_assoc (cyclomatic 20) crates/grit-pattern-matcher/src/pattern/list.rs:57 — grit_pattern_matcher::pattern::list::execute_assoc has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · MarzanoResolvedPattern · ×1
  • MarzanoResolvedPattern::extend (cyclomatic 17) crates/core/src/marzano_resolved_pattern.rs:116 — MarzanoResolvedPattern::extend 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. This is NOT this file's highest cyclomatic complexity: MarzanoResolvedPattern::from_pattern (cyclomatic 26) 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.
D1 · Cyclomatic Complexity · grit_wasm_bindings.debugString (cyclomatic 17) · ×1
  • grit_wasm_bindings.debugString (cyclomatic 17) __generated__/grit-wasm-bindings/grit_wasm_bindings.js:121 — grit_wasm_bindings.debugString has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: grit_wasm_bindings.__wbg_get_imports (cyclomatic 20) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · marzano_wasm_bindings.debugString (cyclomatic 17) · ×1
  • marzano_wasm_bindings.debugString (cyclomatic 17) __generated__/grit-wasm-bindings/marzano_wasm_bindings.js:121 — marzano_wasm_bindings.debugString has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: marzano_wasm_bindings.__wbg_get_imports (cyclomatic 19) 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 method is counted neither in this dimension's figures nor in its score.
D1 · Cyclomatic Complexity · MarzanoContext · ×1
  • MarzanoContext::exec_step (cyclomatic 16) crates/core/src/marzano_context.rs:192 — MarzanoContext::exec_step has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · Match · ×1
  • Match::execute_func (cyclomatic 16) crates/grit-pattern-matcher/src/pattern/match.rs:34 — Match::execute_func has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · marzano_util · ×1
  • marzano_util::diff::parse_modified_ranges (cyclomatic 16) crates/util/src/diff.rs:70 — marzano_util::diff::parse_modified_ranges has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · monaco-diff-editor.MonacoDiffEditor (cyclomatic 16) · ×1
  • monaco-diff-editor.MonacoDiffEditor (cyclomatic 16) docs/src/components/editor/monaco-diff-editor.tsx:34 — monaco-diff-editor.MonacoDiffEditor has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 71, 102, 108). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D10 · Test Quality · Skipped test · ×1
  • Skipped test: can run inside a storage context js/gritql/__test__/napi.spec.mts:14 — Skipped — switched off by it.skip
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D12 · Dependency Hygiene · No go.sum committed (REDACTED) · ×1
  • No go.sum committed (REDACTED) — REDACTED requires 1 module(s) but no `go.sum` is committed beside it, so nothing records the expected checksum of the code this module builds against — `go build` accepts whatever the module proxy serves, and two builds of this commit are not guaranteed to be the same build. Run `go mod tidy` and commit the resulting `go.sum`.
D2 · Cognitive Complexity · gritql_napi · ×1
  • gritql_napi::search::search_internal (cognitive 74) js/gritql/src/search.rs:351 — gritql_napi::search::search_internal has cognitive complexity 74 (threshold 15). Drivers by points: if/else 14 (47 pts), loops 8 (22 pts), match/switch 1 (5 pts) (nesting depth added 51). 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 · Messager · ×1
  • Messager::handle_results_inner (cognitive 73) crates/marzano_messenger/src/emit.rs:96 — Messager::handle_results_inner has cognitive complexity 73 (threshold 15). Drivers by points: if/else 23 (67 pts), match/switch 1 (5 pts), loops 1 (nesting depth added 48). 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 · Contains · ×1
  • Contains::execute (cognitive 66) crates/grit-pattern-matcher/src/pattern/contains.rs:93 — Contains::execute has cognitive complexity 66 (threshold 15). Drivers by points: if/else 32 (52 pts), loops 3 (7 pts), match/switch 2 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · FormattedResult · ×1
  • FormattedResult::fmt (cognitive 48) crates/cli/src/result_formatting.rs:184 — FormattedResult::fmt has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (28 pts), match/switch 4 (11 pts), loops 2 (9 pts) (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.
D2 · Cognitive Complexity · Python · ×1
  • Python::check_replacements (cognitive 48) crates/language/src/python.rs:80 — Python::check_replacements has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (39 pts), loops 2 (7 pts), boolean chains 2 (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 · GritServer · ×1
  • GritServer::execute_command (cognitive 47) crates/lsp/src/server.rs:503 — GritServer::execute_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 8 (17 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarzanoNotebookParser · ×1
  • MarzanoNotebookParser::parse_file_as_notebook (cognitive 45) crates/language/src/notebooks.rs:212 — MarzanoNotebookParser::parse_file_as_notebook has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (33 pts), match/switch 1 (5 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarzanoContext · ×1
  • MarzanoContext::exec_step (cognitive 39) crates/core/src/marzano_context.rs:192 — MarzanoContext::exec_step has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (36 pts), loops 2, boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · State · ×1
  • State::bindings_history_to_ranges (cognitive 39) crates/grit-pattern-matcher/src/pattern/state.rs:424 — State::bindings_history_to_ranges has cognitive complexity 39 (threshold 15). Drivers by points: if/else 5 (26 pts), loops 4 (11 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Match · ×1
  • Match::execute_func (cognitive 35) crates/grit-pattern-matcher/src/pattern/match.rs:34 — Match::execute_func has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 2, match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · LocalRepo · ×1
  • LocalRepo::remote (cognitive 31) REDACTED:126 — LocalRepo::remote has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (31 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · Range · ×1
  • Range::execute (cognitive 27) crates/grit-pattern-matcher/src/pattern/range.rs:69 — Range::execute has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 2 (nesting depth added 16). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · grit_util · ×1
  • grit_util::ast_node_traversal::traverse_iterative (cognitive 25) crates/grit-util/src/ast_node_traversal.rs:57 — grit_util::ast_node_traversal::traverse_iterative has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 2 (3 pts) (nesting depth added 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D2 · Cognitive Complexity · Problem · ×1
  • Problem::execute_paths (cognitive 23) crates/core/src/problem.rs:344 — Problem::execute_paths has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 2 (4 pts) (nesting depth added 15). 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 · grit_wasm_bindings.debugString (cognitive 23) · ×1
  • grit_wasm_bindings.debugString (cognitive 23) __generated__/grit-wasm-bindings/grit_wasm_bindings.js:121 — grit_wasm_bindings.debugString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · marzano_wasm_bindings.debugString (cognitive 23) · ×1
  • marzano_wasm_bindings.debugString (cognitive 23) __generated__/grit-wasm-bindings/marzano_wasm_bindings.js:121 — marzano_wasm_bindings.debugString has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · RegexPattern · ×1
  • RegexPattern::execute_matching (cognitive 22) crates/grit-pattern-matcher/src/pattern/regex.rs:43 — RegexPattern::execute_matching has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Some · ×1
  • Some::execute (cognitive 22) crates/grit-pattern-matcher/src/pattern/some.rs:27 — Some::execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 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 · CallCompiler · ×1
  • CallCompiler::from_node_with_rhs (cognitive 21) crates/core/src/pattern_compiler/call_compiler.rs:21 — CallCompiler::from_node_with_rhs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Every · ×1
  • Every::execute (cognitive 19) crates/grit-pattern-matcher/src/pattern/every.rs:27 — Every::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 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 · Or · ×1
  • Or::execute (cognitive 19) crates/grit-pattern-matcher/src/pattern/or.rs:31 — Or::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Updater · ×1
  • Updater::check_for_update (cognitive 18) crates/cli/src/updater.rs:215 — Updater::check_for_update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · MarzanoLanguage · ×1
  • MarzanoLanguage::align_padding (cognitive 17) crates/language/src/language.rs:318 — MarzanoLanguage::align_padding has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ASTNode · ×1
  • ASTNode::execute (cognitive 16) crates/core/src/ast_node.rs:55 — ASTNode::execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · Within · ×1
  • Within::execute (cognitive 16) crates/grit-pattern-matcher/src/pattern/within.rs:29 — Within::execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
D2 · Cognitive Complexity · marzano_messenger · ×1
  • marzano_messenger::format::get_extended_byte_range (cognitive 16) crates/marzano_messenger/src/format.rs:8 — marzano_messenger::format::get_extended_byte_range has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · grit_wasm_bindings.__wbg_load (cognitive 16) · ×1
  • grit_wasm_bindings.__wbg_load (cognitive 16) __generated__/grit-wasm-bindings/grit_wasm_bindings.js:376 — grit_wasm_bindings.__wbg_load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 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.
D2 · Cognitive Complexity · marzano_wasm_bindings.__wbg_load (cognitive 16) · ×1
  • marzano_wasm_bindings.__wbg_load (cognitive 16) __generated__/grit-wasm-bindings/marzano_wasm_bindings.js:321 — marzano_wasm_bindings.__wbg_load has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), error handling 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · 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
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (5 members, 23 shared lines) · ×1
  • Near-duplicate member family (5 members, 23 shared lines) crates/core/src/pattern_compiler/auto_wrap.rs:79 — crates/core/src/pattern_compiler/auto_wrap.rs:79-138 | crates/core/src/pattern_compiler/auto_wrap.rs:143-202 | crates/core/src/pattern_compiler/auto_wrap.rs:207-296 | crates/core/src/pattern_compiler/auto_wrap.rs:301-369 | crates/core/src/pattern_compiler/step_compiler.rs:22-118 — These 5 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication · Near-duplicate member family (4 members, 23 shared lines) · ×1
  • Near-duplicate member family (4 members, 23 shared lines) crates/core/src/optimizer/hoist_files.rs:299 — crates/core/src/optimizer/hoist_files.rs:299-359 | crates/core/src/optimizer/hoist_text.rs:28-99 | crates/core/src/pattern_compiler/accumulate_compiler.rs:20-89 | crates/core/src/pattern_compiler/rewrite_compiler.rs:21-131 — These 4 members are variants of one another: a block of 23 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them 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 · Near-duplicate member pair (52 shared lines) · ×1
  • Near-duplicate member pair (52 shared lines) crates/core/src/optimizer/hoist_files.rs:205 — crates/core/src/optimizer/hoist_files.rs:205-292 | crates/core/src/optimizer/hoist_text.rs:317-406 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication · Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (14 members, 50+ identical tokens) crates/language/src/csharp.rs:31 — crates/language/src/csharp.rs:31-42 | crates/language/src/css.rs:37-48 | crates/language/src/elixir.rs:33-44 | crates/language/src/go.rs:30-41 | crates/language/src/hcl.rs:30-41 | crates/language/src/html.rs:31-42 | crates/language/src/json.rs:36-47 | crates/language/src/php.rs:38-49 | crates/language/src/php_only.rs:39-50 | crates/language/src/ruby.rs:33-44 | crates/language/src/solidity.rs:31-42 | crates/language/src/sql.rs:30-41 | crates/language/src/toml.rs:30-41 | crates/language/src/vue.rs:32-43 — These 14 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 14 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 14 times.
D4 · Code Duplication · Edited copy of a member (124 corresponding lines) · ×1
  • Edited copy of a member (124 corresponding lines) crates/core/src/optimizer/hoist_files.rs:15 — crates/core/src/optimizer/hoist_files.rs:15-138 | crates/core/src/optimizer/hoist_text.rs:107-249 — These two members are one piece of code written twice and then edited apart: 124 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) crates/grit-pattern-matcher/src/pattern/list_index.rs:66 — crates/grit-pattern-matcher/src/pattern/list_index.rs:66-103 | crates/grit-pattern-matcher/src/pattern/list_index.rs:109-142 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (21 corresponding lines) · ×1
  • Edited copy of a member (21 corresponding lines) crates/grit-pattern-matcher/src/pattern/accessor.rs:57 — crates/grit-pattern-matcher/src/pattern/accessor.rs:57-77 | crates/grit-pattern-matcher/src/pattern/accessor.rs:83-103 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (25 corresponding lines) · ×1
  • Edited copy of a member (25 corresponding lines) crates/core/src/pattern_compiler/not_compiler.rs:23 — crates/core/src/pattern_compiler/not_compiler.rs:23-47 | crates/core/src/pattern_compiler/not_compiler.rs:59-83 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) crates/grit-pattern-matcher/src/pattern/after.rs:67 — crates/grit-pattern-matcher/src/pattern/after.rs:67-89 | crates/grit-pattern-matcher/src/pattern/before.rs:66-88 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) crates/core/src/pattern_compiler/if_compiler.rs:19 — crates/core/src/pattern_compiler/if_compiler.rs:19-33 | crates/core/src/pattern_compiler/if_compiler.rs:45-59 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) crates/lsp/src/manager.rs:79 — crates/lsp/src/manager.rs:79-112 | crates/lsp/src/manager.rs:160-189 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 13+ corresponding lines) crates/cli/src/messenger_variant.rs:43 — crates/cli/src/messenger_variant.rs:43-55 | crates/cli/src/messenger_variant.rs:57-69 | crates/cli/src/messenger_variant.rs:71-83 | crates/cli/src/messenger_variant.rs:85-97 | crates/cli/src/messenger_variant.rs:99-111 | crates/cli/src/messenger_variant.rs:127-139 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) crates/language/src/javascript.rs:45 — crates/language/src/javascript.rs:45-67 | crates/language/src/tsx.rs:44-66 | crates/language/src/typescript.rs:42-62 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) crates/core/src/api.rs:156 — crates/core/src/api.rs:156-168 | crates/core/src/api.rs:185-197 | crates/core/src/api.rs:200-212 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 15+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 15+ corresponding lines) crates/language/src/java.rs:36 — crates/language/src/java.rs:36-50 | crates/language/src/kotlin.rs:37-51 | crates/language/src/rust.rs:36-95 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) crates/core/src/built_in_functions.rs:234 — crates/core/src/built_in_functions.rs:234-247 | crates/core/src/built_in_functions.rs:262-270 | crates/core/src/built_in_functions.rs:277-285 | crates/core/src/built_in_functions.rs:292-300 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) crates/core/src/analysis.rs:181 — crates/core/src/analysis.rs:181-190 | crates/core/src/pattern_compiler/compiler.rs:646-657 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×1
  • Edited copy of a member (9 corresponding lines) crates/core/src/sdk/binding.rs:115 — crates/core/src/sdk/binding.rs:115-123 | js/gritql/src/binding.rs:89-97 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) crates/lsp/src/util.rs:45 — crates/lsp/src/util.rs:45-62 | crates/lsp/src/util.rs:102-117 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 12+ corresponding lines) crates/core/src/optimizer/hoist_files.rs:191 — crates/core/src/optimizer/hoist_files.rs:191-202 | crates/core/src/optimizer/hoist_text.rs:288-299 | crates/core/src/optimizer/hoist_text.rs:303-314 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 6+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 6+ corresponding lines) crates/grit-pattern-matcher/src/pattern/add.rs:38 — crates/grit-pattern-matcher/src/pattern/add.rs:38-43 | crates/grit-pattern-matcher/src/pattern/divide.rs:38-43 | crates/grit-pattern-matcher/src/pattern/multiply.rs:38-43 | crates/grit-pattern-matcher/src/pattern/subtract.rs:38-43 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) crates/grit-pattern-matcher/src/pattern/function_definition.rs:55 — crates/grit-pattern-matcher/src/pattern/function_definition.rs:55-60 | crates/grit-pattern-matcher/src/pattern/predicate_definition.rs:40-45 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×1
  • Edited copy of a member (4 corresponding lines) crates/core/src/sdk/binding.rs:87 — crates/core/src/sdk/binding.rs:87-90 | js/gritql/src/binding.rs:39-42 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (5 members, 4+ corresponding lines) · ×1
  • Edited copies of one member (5 members, 4+ corresponding lines) crates/grit-pattern-matcher/src/pattern/add.rs:28 — crates/grit-pattern-matcher/src/pattern/add.rs:28-31 | crates/grit-pattern-matcher/src/pattern/divide.rs:28-31 | crates/grit-pattern-matcher/src/pattern/modulo.rs:28-31 | crates/grit-pattern-matcher/src/pattern/multiply.rs:28-31 | crates/grit-pattern-matcher/src/pattern/subtract.rs:28-31 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 4 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) crates/grit-pattern-matcher/src/file_owners.rs:35 — crates/grit-pattern-matcher/src/file_owners.rs:35-39 | crates/grit-util/src/analysis_logs.rs:62-64 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) crates/core/src/optimizer/hoist_files.rs:107 — crates/core/src/optimizer/hoist_files.rs:107-138 | crates/core/src/optimizer/hoist_text.rs:218-249 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/optimizer/hoist_files.rs:107` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) crates/gritmodule/src/resolver.rs:539 — crates/gritmodule/src/resolver.rs:539-565 | crates/gritmodule/src/resolver.rs:590-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/gritmodule/src/resolver.rs:617` calls `context` and `crates/gritmodule/src/resolver.rs:566` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) crates/core/src/optimizer/hoist_files.rs:206 — crates/core/src/optimizer/hoist_files.rs:206-227 | crates/core/src/optimizer/hoist_text.rs:318-339 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/optimizer/hoist_files.rs:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) crates/core/src/sdk/binding.rs:140 — crates/core/src/sdk/binding.rs:140-159 | js/gritql/src/binding.rs:47-65 — before extracting anything, compare `crates/core/src/sdk/binding.rs` and `js/gritql/src/binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (18–19 lines × 2) · ×1
  • Duplicated block (18–19 lines × 2) crates/gritmodule/src/resolver.rs:239 — crates/gritmodule/src/resolver.rs:239-257 | crates/gritmodule/src/resolver.rs:296-313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/gritmodule/src/resolver.rs:239` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) crates/cli/src/commands/blueprints.rs:47 — crates/cli/src/commands/blueprints.rs:47-63 | crates/cli/src/commands/workflows_upload.rs:62-79 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/commands/blueprints.rs:47` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (16 lines × 3) · ×1
  • Duplicated block (16 lines × 3) crates/core/src/pattern_compiler/auto_wrap.rs:180 — crates/core/src/pattern_compiler/auto_wrap.rs:180-195 | crates/core/src/pattern_compiler/auto_wrap.rs:273-288 | crates/core/src/pattern_compiler/auto_wrap.rs:347-362 — 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–15 lines × 2) · ×1
  • Duplicated block (12–15 lines × 2) crates/grit-pattern-matcher/src/pattern/contains.rs:165 — crates/grit-pattern-matcher/src/pattern/contains.rs:165-179 | crates/grit-pattern-matcher/src/pattern/contains.rs:205-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) crates/core/src/optimizer/hoist_files.rs:309 — crates/core/src/optimizer/hoist_files.rs:309-322 | crates/core/src/optimizer/hoist_text.rs:48-61 | crates/core/src/pattern_compiler/accumulate_compiler.rs:36-49 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/optimizer/hoist_files.rs:323` calls `CallbackPattern` and `crates/core/src/pattern_compiler/accumulate_compiler.rs:50` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 3) · ×1
  • Duplicated block (13 lines × 3) crates/core/src/pattern_compiler/auto_wrap.rs:103 — crates/core/src/pattern_compiler/auto_wrap.rs:103-115 | crates/core/src/pattern_compiler/auto_wrap.rs:168-180 | crates/core/src/pattern_compiler/auto_wrap.rs:261-273 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:102` calls `CallbackPattern` and `crates/core/src/pattern_compiler/auto_wrap.rs:260` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×1
  • Duplicated block (13 lines × 2) crates/cli/src/commands/workflows_watch.rs:23 — crates/cli/src/commands/workflows_watch.rs:23-35 | crates/cli/src/workflows.rs:330-342 — 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.
D4 · Code Duplication · Duplicated block (12 lines × 6) · ×1
  • Duplicated block (12 lines × 6) crates/core/src/pattern_compiler/auto_wrap.rs:110 — crates/core/src/pattern_compiler/auto_wrap.rs:110-121 | crates/core/src/pattern_compiler/auto_wrap.rs:175-186 | crates/core/src/pattern_compiler/auto_wrap.rs:268-279 | crates/core/src/pattern_compiler/auto_wrap.rs:342-353 | crates/core/src/pattern_compiler/step_compiler.rs:51-62 | crates/grit-pattern-matcher/src/pattern/includes.rs:83-94 — before extracting anything, compare `crates/core/src/pattern_compiler/auto_wrap.rs` and `crates/core/src/pattern_compiler/step_compiler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:123` calls `Contains` and `crates/core/src/pattern_compiler/auto_wrap.rs:188` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (12 lines × 5) · ×1
  • Duplicated block (12 lines × 5) crates/core/src/marzano_resolved_pattern.rs:583 — crates/core/src/marzano_resolved_pattern.rs:583-594 | crates/core/src/optimizer/hoist_files.rs:324-335 | crates/core/src/optimizer/hoist_text.rs:63-74 | crates/core/src/pattern_compiler/accumulate_compiler.rs:50-61 | crates/core/src/pattern_compiler/rewrite_compiler.rs:85-96 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/accumulate_compiler.rs:47` calls `CallBuiltIn`, `CallFunction`, `CallForeignFunction` and `crates/core/src/marzano_resolved_pattern.rs:582` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 14) · ×1
  • Duplicated block (11 lines × 14) crates/language/src/csharp.rs:32 — crates/language/src/csharp.rs:32-42 | crates/language/src/css.rs:38-48 | crates/language/src/elixir.rs:34-44 | crates/language/src/go.rs:31-41 | crates/language/src/hcl.rs:31-41 | crates/language/src/html.rs:32-42 | crates/language/src/json.rs:37-47 | crates/language/src/php.rs:39-49 | crates/language/src/php_only.rs:40-50 | crates/language/src/ruby.rs:34-44 | crates/language/src/solidity.rs:32-42 | crates/language/src/sql.rs:31-41 | crates/language/src/toml.rs:31-41 | crates/language/src/vue.rs:33-43 — 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 14 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (11 lines × 5) · ×1
  • Duplicated block (11 lines × 5) crates/core/src/optimizer/hoist_files.rs:344 — crates/core/src/optimizer/hoist_files.rs:344-354 | crates/core/src/optimizer/hoist_text.rs:84-94 | crates/core/src/pattern_compiler/accumulate_compiler.rs:72-82 | crates/core/src/pattern_compiler/rewrite_compiler.rs:106-116 | crates/grit-pattern-matcher/src/pattern/includes.rs:99-109 — before extracting anything, compare `crates/core/src/optimizer/hoist_files.rs` and `crates/core/src/optimizer/hoist_text.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 166 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/optimizer/hoist_text.rs:82` calls `Contains`, `Includes` and `crates/core/src/optimizer/hoist_files.rs:343` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (11 lines × 3) · ×1
  • Duplicated block (11 lines × 3) crates/language/src/javascript.rs:118 — crates/language/src/javascript.rs:118-128 | crates/language/src/tsx.rs:122-132 | crates/language/src/typescript.rs:118-128 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) crates/core/src/analysis.rs:119 — crates/core/src/analysis.rs:119-129 | crates/core/src/pattern_compiler/compiler.rs:576-584 — 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.
D4 · Code Duplication · Duplicated block (10 lines × 8) · ×1
  • Duplicated block (10 lines × 8) crates/core/src/pattern_compiler/accumulate_compiler.rs:57 — crates/core/src/pattern_compiler/accumulate_compiler.rs:57-66 | crates/core/src/pattern_compiler/auto_wrap.rs:109-118 | crates/core/src/pattern_compiler/auto_wrap.rs:174-183 | crates/core/src/pattern_compiler/auto_wrap.rs:267-276 | crates/core/src/pattern_compiler/auto_wrap.rs:341-350 | crates/core/src/pattern_compiler/rewrite_compiler.rs:92-101 | crates/core/src/pattern_compiler/step_compiler.rs:50-59 | crates/grit-pattern-matcher/src/pattern/includes.rs:82-91 — before extracting anything, compare `crates/core/src/pattern_compiler/accumulate_compiler.rs` and `crates/core/src/pattern_compiler/rewrite_compiler.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 45 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/accumulate_compiler.rs:54` calls `Maybe` and `crates/core/src/pattern_compiler/auto_wrap.rs:106` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (10 lines × 5) · ×1
  • Duplicated block (10 lines × 5) crates/core/src/pattern_compiler/auto_wrap.rs:125 — crates/core/src/pattern_compiler/auto_wrap.rs:125-134 | crates/core/src/pattern_compiler/auto_wrap.rs:189-198 | crates/core/src/pattern_compiler/auto_wrap.rs:282-291 | crates/core/src/pattern_compiler/auto_wrap.rs:356-365 | crates/core/src/pattern_compiler/step_compiler.rs:65-74 — before extracting anything, compare `crates/core/src/pattern_compiler/auto_wrap.rs` and `crates/core/src/pattern_compiler/step_compiler.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/auto_wrap.rs:123` calls `Contains` and `crates/core/src/pattern_compiler/auto_wrap.rs:187` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9–10 lines × 5) · ×1
  • Duplicated block (9–10 lines × 5) crates/gritmodule/src/formatting.rs:77 — crates/gritmodule/src/formatting.rs:77-85 | crates/gritmodule/src/formatting.rs:99-107 | crates/gritmodule/src/formatting.rs:120-128 | crates/gritmodule/src/formatting.rs:142-150 | crates/gritmodule/src/formatting.rs:165-174 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/gritmodule/src/formatting.rs:76` calls `arg` and `crates/gritmodule/src/formatting.rs:119` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (8–9 lines × 2) · ×1
  • Duplicated block (8–9 lines × 2) crates/core/src/pattern_compiler/accumulate_compiler.rs:76 — crates/core/src/pattern_compiler/accumulate_compiler.rs:76-84 | crates/core/src/pattern_compiler/step_compiler.rs:68-75 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/core/src/pattern_compiler/accumulate_compiler.rs:75` calls `Where` and `crates/core/src/pattern_compiler/step_compiler.rs:67` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) crates/core/src/pattern_compiler/and_compiler.rs:43 — crates/core/src/pattern_compiler/and_compiler.rs:43-49 | crates/core/src/pattern_compiler/any_compiler.rs:42-48 | crates/core/src/pattern_compiler/or_compiler.rs:42-48 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/and_compiler.rs:43` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (5 lines × 3) · ×1
  • Duplicated block (5 lines × 3) crates/language/src/java.rs:37 — crates/language/src/java.rs:37-41 | crates/language/src/kotlin.rs:38-42 | crates/language/src/rust.rs:37-41 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/language/src/java.rs:37` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 4) · ×1
  • Duplicated block (6 lines × 4) crates/grit-pattern-matcher/src/pattern/add.rs:59 — crates/grit-pattern-matcher/src/pattern/add.rs:59-64 | crates/grit-pattern-matcher/src/pattern/divide.rs:59-64 | crates/grit-pattern-matcher/src/pattern/multiply.rs:59-64 | crates/grit-pattern-matcher/src/pattern/subtract.rs:59-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 all 4 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/grit-pattern-matcher/src/pattern/add.rs:59` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×1
  • Duplicated block (14 lines × 2) crates/language/src/tsx.rs:49 — crates/language/src/tsx.rs:49-62 | crates/language/src/typescript.rs:46-59 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/language/src/tsx.rs:49` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×1
  • Duplicated block (7 lines × 4) crates/core/src/pattern_compiler/function_definition_compiler.rs:28 — crates/core/src/pattern_compiler/function_definition_compiler.rs:28-35 | crates/core/src/pattern_compiler/function_definition_compiler.rs:71-77 | crates/core/src/pattern_compiler/pattern_definition_compiler.rs:25-33 | crates/core/src/pattern_compiler/predicate_definition_compiler.rs:24-32 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/core/src/pattern_compiler/function_definition_compiler.rs:28` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D5 · Coupling · Unstable project marzano-lsp · ×1
  • Unstable project marzano-lsp — marzano-lsp has instability 0.86 with 1 dependents.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — .NET and JavaScript/TypeScript suite — Coverage NOT MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half could not be measured — the bun:test suite in js/gritql/ ran and not one test passed (error: Error: Failed to fetch standard library grit module getgrit/stdlib. Try running `grit init` first to create a local .grit directory.), so the coverage report describes the failed run, not the code. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
P1 · CI/CD gates · CI formatting step cannot fail · ×1
  • CI formatting step cannot fail REDACTED:45 — `prettier --version` invokes prettier in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking js/gritql/src/search.rs:171 — `prep_query` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Minor — 235 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×179
  • Orphaned file crates/language/src/target_language.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/pattern_compiler/compiler.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/api.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/util/src/diff.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/lsp/src/server.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/gritmodule/src/markdown.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/cli/src/commands/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/inline_snippets.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/cli/src/updater.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/language/src/language.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/built_in_functions.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/marzano_binding.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/wasm-bindings/src/match_pattern.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/cli/src/result_formatting.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/problem.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file REDACTED:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/pattern_compiler/pattern_compiler.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/optimizer/hoist_text.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/cli/src/commands/apply_pattern.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/pattern_compiler/auto_wrap.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file js/gritql/src/search.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/grit-pattern-matcher/src/pattern/state.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/core/src/analysis.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/cli/src/workflows.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file crates/grit-pattern-matcher/src/pattern/variable.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • + 154 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×22
  • Duplicated predicate resources/language-metavariables/tree-sitter-elixir/grammar.js:59 — `!/[a-z]/.test(operator) && operator !== "=>"` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-elixir/grammar.js, resources/metavariable-grammars/elixir-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate __generated__/grit-wasm-bindings/grit_wasm_bindings.js:97 — `cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0` appears character-identically in 2 files — __generated__/grit-wasm-bindings/grit_wasm_bindings.js, __generated__/grit-wasm-bindings/marzano_wasm_bindings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate __generated__/grit-wasm-bindings/grit_wasm_bindings.js:239 — `cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0` appears character-identically in 2 files — __generated__/grit-wasm-bindings/grit_wasm_bindings.js, __generated__/grit-wasm-bindings/marzano_wasm_bindings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate __generated__/grit-wasm-bindings/grit_wasm_bindings.js:30 — `cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0` appears character-identically in 2 files — __generated__/grit-wasm-bindings/grit_wasm_bindings.js, __generated__/grit-wasm-bindings/marzano_wasm_bindings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/grammar.js:455 — `delimiter == 'star' || delimiter == 'underscore'` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/tree-sitter-markdown-inline/grammar.js, resources/metavariable-grammars/markdown-inline-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-php/common/define-grammar.js:49 — `dialect !== 'php' && dialect !== 'php_only'` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-php/common/define-grammar.js, resources/metavariable-grammars/php-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:2 — `process.env.EXTENSION_GFM || exports.EXTENSION_DEFAULT || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:9 — `process.env.EXTENSION_LATEX || exports.EXTENSION_DEFAULT || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:6 — `process.env.EXTENSION_MINUS_METADATA || exports.EXTENSION_DEFAULT || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:5 — `process.env.EXTENSION_PIPE_TABLE || exports.EXTENSION_GFM || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:7 — `process.env.EXTENSION_PLUS_METADATA || exports.EXTENSION_DEFAULT || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:4 — `process.env.EXTENSION_STRIKETHROUGH || exports.EXTENSION_GFM || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:8 — `process.env.EXTENSION_TAGS || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:3 — `process.env.EXTENSION_TASK_LIST || exports.EXTENSION_GFM || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-markdown/common/grammar.js:10 — `process.env.EXTENSION_WIKI_LINK || process.env.ALL_EXTENSIONS` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-markdown/common/grammar.js, resources/metavariable-grammars/markdown-common-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate resources/language-metavariables/tree-sitter-yaml/grammar.js:1372 — `rule_name in alias_map && alias_map[rule_name].shallow` appears character-identically in 2 files — resources/language-metavariables/tree-sitter-yaml/grammar.js, resources/metavariable-grammars/yaml-metavariable-grammar.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate __generated__/grit-wasm-bindings/grit_wasm_bindings.js:949 — `typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof U…` appears character-identically in 2 files — __generated__/grit-wasm-bindings/grit_wasm_bindings.js, __generated__/grit-wasm-bindings/marzano_wasm_bindings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate __generated__/grit-wasm-bindings/grit_wasm_bindings.js:140 — `typeof name == 'string' && name.length > 0` appears character-identically in 2 files — __generated__/grit-wasm-bindings/grit_wasm_bindings.js, __generated__/grit-wasm-bindings/marzano_wasm_bindings.js. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/language/src/javascript.rs:123 — `content_text.starts_with("/*") && content_text.ends_with("*/")` appears character-identically in 3 files — crates/language/src/javascript.rs, crates/language/src/tsx.rs, crates/language/src/typescript.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/language/src/grit_parser.rs:72 — `n.node.is_error() || n.node.is_missing()` appears character-identically in 2 files — crates/language/src/grit_parser.rs, crates/language/src/language.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/core/src/analysis.rs:145 — `n.node.is_named() && (n.node.kind() == node_like || n.node.kind() == predicate_call)` appears character-identically in 2 files — crates/core/src/analysis.rs, crates/core/src/pattern_compiler/compiler.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate crates/language/src/javascript.rs:159 — `self.is_comment_sort(node.node.kind_id()) || js_like_is_comment(node, self.comment_sort, self.jsx_sort)` appears character-identically in 2 files — crates/language/src/javascript.rs, crates/language/src/tsx.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
D19 · Documentation Quality · Documentation · ×12
  • Documentation: no build, run or usage example js/gritql/npm/android-arm64/README.md:1 — `android-arm64` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/android-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/darwin-arm64/README.md:1 — `darwin-arm64` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/darwin-arm64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/darwin-universal/README.md:1 — `darwin-universal` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/darwin-universal/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/darwin-x64/README.md:1 — `darwin-x64` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/darwin-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/freebsd-x64/README.md:1 — `freebsd-x64` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/freebsd-x64/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/linux-arm64-gnu/README.md:1 — `linux-arm64-gnu` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/linux-arm64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/linux-arm64-musl/README.md:1 — `linux-arm64-musl` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/linux-arm64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/linux-riscv64-gnu/README.md:1 — `linux-riscv64-gnu` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/linux-riscv64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/linux-x64-gnu/README.md:1 — `linux-x64-gnu` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/linux-x64-gnu/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/linux-x64-musl/README.md:1 — `linux-x64-musl` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/linux-x64-musl/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/win32-arm64-msvc/README.md:1 — `win32-arm64-msvc` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/win32-arm64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
  • Documentation: no build, run or usage example js/gritql/npm/win32-x64-msvc/README.md:1 — `win32-x64-msvc` is a published package (`REDACTED` without `"private": true`) and neither `js/gritql/npm/win32-x64-msvc/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
X7 · Silent fallback defaults · Silent fallback default on Err · ×6
  • Silent fallback default on Err REDACTED:83 — `from_dir` turns every `Err` into `Default::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/gritmodule/src/resolver.rs:409 — `resolve_patterns` turns every `Err` into `false` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/lsp/src/patterns.rs:53 — `resolve_from_uri` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/lsp/src/patterns.rs:74 — `get_grit_files_from_uri` turns every `Err` into `PatternsDirectory::new()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/lsp/src/watcher.rs:8 — `get_watched_files` turns every `Err` into `vec![]` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
  • Silent fallback default on Err crates/util/src/diff.rs:39 — `parse_hunk_part` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
D34 · Knowledge Freshness · Most significant orphaned file · ×3
  • Most significant orphaned file crates/core/src/test.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file crates/core/src/marzano_resolved_pattern.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
  • Most significant orphaned file crates/gritmodule/src/resolver.rs:1 — One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D30 · Dependency Vulnerabilities · Low CVE · ×2
  • REDACTED
  • REDACTED
X7 · Silent fallback defaults · Silent fallback default in catch · ×2
  • Silent fallback default in catch __generated__/grit-wasm-bindings/grit_wasm_bindings.js:174 — `debugString` swallows every exception into `return 'Object'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
  • Silent fallback default in catch __generated__/grit-wasm-bindings/marzano_wasm_bindings.js:174 — `debugString` swallows every exception into `return 'Object'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 3 significant file(s) lose their only recent owner: crates/cli/src/result_formatting.rs, crates/cli/src/workflows.rs, crates/cli/src/commands/apply_migration.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (4 single-owned of 183 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 183 of the 340 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/grit-pattern-matcher/src/pattern/regex.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj:3 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/Generator.csproj` makes this repository a deployable product (line 3).
D34 · Knowledge Freshness · Concentrated knowledge decay · ×1
  • Concentrated knowledge decay — 182 of 183 significant files have no living knowledge, while the repository is still being changed at a low rate (12 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 182 separate risks. Counted over 183 of the 340 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
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 9/12 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `crates/cli_bin`, `docs`.
P3 · Security & performance tooling · No dependency-update automation · ×1
  • No dependency-update automation REDACTED:8 — `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
X5 · Nullable reference types · Nullable reference types not enabled everywhere · ×1
  • Nullable reference types not enabled everywhere — 0/1 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Minor — 2 finding(s)
D12 · Dependency Hygiene · Outdated · ×1
  • Outdated: github.com/tree-sitter/go-tree-sitter — `github.com/tree-sitter/go-tree-sitter` is required at v0.23.1 in REDACTED, but v0.24.0 is the module's current release — so this build is missing every fix published since, including any security fix. Run `go get github.com/tree-sitter/go-tree-sitter@v0.24.0 && go mod tidy` and commit the updated REDACTED and go.sum.
D24 · Comment Value · doc comments repeat the names · ×1
  • doc comments repeat the names crates/cli_bin/fixtures/test_jsx.js:111 — 0 of 3 documented parameters and 0 of 21 summaries in `@getgrit/gritql` only repeat the member or parameter name (e.g. "" for `options`). 1 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-896945156ca64729b13acd399dbd953c/history.json --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-896945156ca64729b13acd399dbd953c/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude resources/language-metavariables/tree-sitter-c-sharp/tools/highlight-test-generator/obj --exclude resources/language-metavariables/tree-sitter-c-sharp --exclude resources/language-metavariables/tree-sitter-css --exclude resources/language-metavariables/tree-sitter-elixir/bindings --exclude resources/language-metavariables/tree-sitter-elixir/docs --exclude resources/language-metavariables/tree-sitter-elixir/queries --exclude resources/language-metavariables/tree-sitter-elixir/scripts --exclude resources/language-metavariables/tree-sitter-elixir/src/tree_sitter --exclude resources/language-metavariables/tree-sitter-elixir/test --exclude resources/language-metavariables/tree-sitter-go --exclude resources/language-metavariables/tree-sitter-hcl --exclude resources/language-metavariables/tree-sitter-html --exclude resources/language-metavariables/tree-sitter-java --exclude resources/language-metavariables/tree-sitter-javascript --exclude resources/language-metavariables/tree-sitter-json --exclude resources/language-metavariables/tree-sitter-kotlin --exclude resources/language-metavariables/tree-sitter-markdown --exclude resources/language-metavariables/tree-sitter-php/bindings --exclude resources/language-metavariables/tree-sitter-php/common --exclude resources/language-metavariables/tree-sitter-php/php/bindings --exclude resources/language-metavariables/tree-sitter-php/php/src --exclude resources/language-metavariables/tree-sitter-php/php_only/bindings --exclude resources/language-metavariables/tree-sitter-php/php_only/src --exclude resources/language-metavariables/tree-sitter-php/queries --exclude resources/language-metavariables/tree-sitter-php/script --exclude resources/language-metavariables/tree-sitter-python --exclude resources/language-metavariables/tree-sitter-ruby --exclude resources/language-metavariables/tree-sitter-rust --exclude resources/language-metavariables/tree-sitter-solidity --exclude resources/language-metavariables/tree-sitter-sql --exclude resources/language-metavariables/tree-sitter-toml --exclude resources/language-metavariables/tree-sitter-typescript/bindings --exclude resources/language-metavariables/tree-sitter-typescript/build --exclude resources/language-metavariables/tree-sitter-typescript/common --exclude resources/language-metavariables/tree-sitter-typescript/examples --exclude resources/language-metavariables/tree-sitter-typescript/queries --exclude resources/language-metavariables/tree-sitter-typescript/script --exclude resources/language-metavariables/tree-sitter-typescript/tsx/src --exclude resources/language-metavariables/tree-sitter-typescript/typescript/src --exclude resources/language-metavariables/tree-sitter-vue --exclude resources/language-metavariables/tree-sitter-yaml --exclude resources/metavariable-grammars --exclude resources/node-types .16artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .144artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .0artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .0artifacts/raw/trivy-fs.json

Run 01a1dba8-728c-7439-830e-07dc4ffc31c7 · 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