Public report — kennel.canine.dev, published 15 Sep 2026.
Concrete security findings (CVE IDs, secret matches, dependency versions) are hidden in this version;
ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.11 (frozen) · verify this surveyFiledcd_488af2fde77a42e6970f9149967021ef
Filed 15 September 2026, 14:19 UTC
Public
Large · 311,166 LoC · 25 projects · rebuild ~46.8 person-years · weakest lens: Accessibility (73%)
Findings by grade
73 critical3265 serious185 minor3 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
15 September 2026, 13:13 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
3464findings with an exact file:lineof 3523 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
112/143dimensions across the health lenses311166 LoC · 25 projects — wide & deep
The system holds a strong overall standing with a health score of 77%, indicating a robust asset that is largely well-architected and secure. However, beneath this solid foundation lies a significant, compounding cost to delivery speed driven by maintainability issues. The platform is substantial, comprising over 311,000 lines of production code, with a hypothetical rebuild costing nearly €6.8 million and requiring dozens of engineers for years. This scale underscores the high value at stake and the critical importance of preserving and optimizing the existing logic rather than replacing it.
The primary risk is a persistent velocity tax on every change. Code quality signals suggest that modifications in weaker areas cost 5–12% more effort than in clean code. This inefficiency acts as a recurring bill on the team’s annual output, slowing feature delivery and increasing long-term maintenance costs without any immediate visibility. It is a silent drag on productivity that compounds as the codebase grows, directly impacting the speed at which new business value can be released.
A secondary, high-leverage opportunity exists in accessibility. The top-ranked fix involves making custom controls keyboard-operable and ensuring proper labeling. This single action pays for itself within one to two months by reducing the annual drag on engineering capacity. Addressing this now yields immediate returns, freeing up resources for other initiatives and demonstrating a commitment to inclusive design without significant upfront investment.
Strengths include excellent architectural cohesion and domain modeling, which provide a stable base for future growth. Security and production readiness are also strong, minimizing exposure to outages and vulnerabilities. The focus should be on the accessibility improvements, as they offer the highest return on effort. While some areas like event-driven patterns were not measured, the current picture is clear enough to act. Prioritizing these quick wins will stabilize delivery velocity and enhance user trust.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Every measured lens already clears the Healthy floor — there is no single drag to lift.
Code composition — where the lines go
Business logic 21%Plumbing 5%Tests 73%Analyzers 0%
New since the last scan (100+)
166 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €2,200,000–€11,000,000
1.2× (at 77% quality) — the last 20% of quality is most of the work
Size & shape
Large · effort split not classified for 72,119 line(s) outside the .NET model (the tier breakdown is a C#-only syntax walk)
Dead frontend code
~122 LoC unreachable (2 file(s)) — that slice of this estimate buys code with zero runtime value; deleting it is the cheapest win in this report (the R7 card lists every file)
This codebase represents roughly ~46.8 person-years of build effort (about ~€6,800,000 to rebuild). Its weakest lens is Accessibility at 73% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Very high (×2.0) — service/app, DDD/clean architecture, CQRS, domain model, event sourcing, high decision density × a 1.2× quality factor, at €60–95/h; indicative, ±~30%. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 1319.5–7917.3 engineer-days every year, paid as drag on the ~9,721,171 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 5–12% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 2,397,001 line(s) changed over a 90-day window ⇒ ~9,721,171/year · D1/D2/D4/D6 code quality: averaging 5.8/10 ⇒ a 5–12% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 5.8/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 5–12% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 5.8/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — bounded-context dependency graph
Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
312 modules, 356 dependencies. 5 dependency cycles across 18 modules, marked above the diagonal.
Showing the 40 most-connected modules; 272 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
108 distinct (type in Core.ModelAware → type in Core.CodeModel) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Core.ModelAware uses Core.Frontend. Changing Core.Frontend can break Core.ModelAware, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→20 Core.ModelAware depends on Core.Scoringcycle✕
Type pairs
36 distinct (type in Core.ModelAware → type in Core.Scoring) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Dimensions.Architecture.Llm uses Llm.Abstractions.Validation. Changing Llm.Abstractions.Validation can break Dimensions.Architecture.Llm, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
21→19 Dimensions.Architecture.Llm depends on Core.Architecture✕
Type pairs
2 distinct (type in Dimensions.Architecture.Llm → type in Core.Architecture) references.
Dimensions.Security uses Core.FileQuality. Changing Core.FileQuality can break Dimensions.Security, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→20 Dimensions.Security depends on Core.Scoring✕
Type pairs
26 distinct (type in Dimensions.Security → type in Core.Scoring) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Dimensions.Security uses Core.Scoring. Changing Core.Scoring can break Dimensions.Security, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→22 Dimensions.Security depends on Core.Dimensions✕
Type pairs
47 distinct (type in Dimensions.Security → type in Core.Dimensions) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A02:2021 — Cryptographic Failures
24
High / Critical
A03:2021 — Injection
7
High / Critical
A05:2021 — Security Misconfiguration
3
High / Critical
Roadmap
First, ensure all interactive elements are fully keyboard-accessible and every form control has a proper programmatic label. Next, establish a solid page structure by defining language, title, main landmark, and correct heading hierarchy. Then, reduce cyclomatic complexity in branch-heavy functions to improve maintainability. Finally, split the largest source files into smaller, focused modules to enhance code organization.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
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 — 73
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 — 3265
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 — 185
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 3
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 107 of 112 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 112 dimensions across the health lenses
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 3464 of 3523 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 27,599 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 208 test source file(s) (.go, .ts, .py, .mjs, .js, .tsx, .cjs) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: this repository's test suite spans .NET and JavaScript/TypeScript, and the JavaScript/TypeScript half could not be re-run — unit: measured (0 flaky); integration: not included — too large to re-run within its budget; other: measured (0 flaky); JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in engine/tests/CodeHealth.Tests.Fixtures/SampleSolutions/FrontendWorkspace/packages/app/; vitest via `npm ci --ignore-scripts` in engine/tests/CodeHealth.Tests.Fixtures/frontend-mini/packages/app/): not included — the install for engine/tests/CodeHealth.Tests.Fixtures/SampleSolutions/FrontendWorkspace/packages/app/ left no `vitest` binary under node_modules, so the suite could not be launched. No partial figure is published as if it were the whole: reliability is excluded from the score rather than counted as a near-zero.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in engine/tests/CodeHealth.Tests.Fixtures/SampleSolutions/FrontendWorkspace/packages/app/ was NOT MEASURED: the install for engine/tests/CodeHealth.Tests.Fixtures/SampleSolutions/FrontendWorkspace/packages/app/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in engine/tests/CodeHealth.Tests.Fixtures/frontend-mini/packages/app/ was NOT MEASURED: the install for engine/tests/CodeHealth.Tests.Fixtures/frontend-mini/packages/app/ left no `vitest` binary under node_modules, so the suite could not be launched. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (4 contributor(s) across 6832 commit(s) sampled, automation and bot accounts excluded). One of them holds 100% of the history; the other 3 hold 0% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
D18 Solution Shape — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A scan analyzes ONE solution. Every score, lens, and finding here reflects only `engine/CodeHealth.sln`; 1 further solution(s) found in this tree (`Kennel.slnx`) are not covered by it, were not analyzed, and are not represented in the headline. (This is a count of the solutions discovery found and could not show to be covered by the analyzed one — not a claim about how many solution files the repository contains.) If one of them is an archived or vendored tree, declaring it — `.gitattributes` (`path/** linguist-vendored`) or `.editorconfig` (`[path/**] generated_code = true`) — excludes it from discovery the same way generated code is. You can widen what we reach: scan each solution separately.
D21 Naming Consistency — LLM provider failed — The model provider returned an unusable result, so this LLM-assisted dimension fell back to a measurement gap (confidence 0) rather than a penalty. Re-run with a reachable provider to score it.
D23 Boundary Type-Coupling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 31 bounded context(s) were resolved, but of the 3897 public type(s) this run scanned, none could be attributed to any of them — so no cross-boundary leak was reachable and an empty result was guaranteed regardless of the code. This happens when the scored code model is a non-.NET (sidecar) primary while the contexts were resolved from .NET project directories, which key on assembly name. Not scored: this is a gap in the analyzer, not a verdict about this repository. You can widen what we reach: declare this codebase's bounded contexts by module-path or namespace prefix so they resolve against the languages actually scanned. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Main.java`, `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs`, `engine/src/CodeHealth.Cli/Commands/DimensionsCommand.cs`, `engine/src/CodeHealth.Cli/Commands/RecordingToolRunner.cs`, `engine/src/CodeHealth.Cli/Commands/SpecCommand.cs`, … (+708 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AC1 Text alternatives — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC2 Forms & labels — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC3 Page structure — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC4 Keyboard semantics — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC5 ARIA correctness — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
AC6 Visual & motion safety — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository builds user interface as HTML STRINGS assigned through innerHTML — 32 script file(s) building 235 markup element(s) as HTML strings, carrying 29 role/aria/tabindex attribute(s) (e.g. tools/localdev/ui/capture.mjs, tools/localdev/ui/corpus-e2e.mjs, tools/localdev/ui/corpus-e2e.test.mjs) — and the accessibility cards on this run were measured over the 198 parsed markup document(s) ONLY. The markup model reads .html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx, html`…` templates in .ts/.js, the .erb/.ejs/.eex/.heex/.leex/.twig/.jinja/.j2/.liquid/.njk/.hbs/.mustache/.blade.php/.gohtml template languages, and .astro/.templ/.pug/.jade/.haml/.slim; it has no producer for markup built as string literals, so those elements were not merely unparsed but unenumerated: not one of them entered the population any card scored. Their absence from the counts above is a gap in this analyzer's frontend coverage — not a finding that they carry text alternatives, labels, keyboard semantics or correct ARIA.
DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Some of this repository's production types come from a frontend that does not declare whether a construction is produced or passed, which arm two needs to tell a producer from a mapping, and those types were not walked for this dimension. The counts above speak for the languages that declare it.
DM9 Scattered domain decisions — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The frontend declares that it computes whether a construction is produced or passed, yet 56 of 146 constructions arrived without the answer. Arm two skipped them; it did not clear them.
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
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D8 Code Coverage: Coverage is measured by building and running the test suite inside Watchdog's isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
C5 Data-Subject Rights: This control is scored from in-repo evidence only — absence of evidence here means the scan found no in-repo trace, not that the control does not exist.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (5): D19, D20, D22, D24, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
785 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was DependencyHygieneAnalyzer.RunAsync at 252. A further 42 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 ProductionReadinessAnalyzer.HasDedicatedSastSignal at 48 — 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: engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/EmitterNames.java (EmitterNames.special at 27), engine/src/CodeHealth.Core/Architecture/Topology/Extractors/AspireAppHostExtractor.cs (AspireAppHostExtractor.Infra at 24), engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMappings.cs (RoslynMappings.ToSpecialKind at 23), engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Emitter.kt (Emitter.special at 20), engine/src/CodeHealth.Core/Markup/MarkupElement.cs (MarkupElement.HasBoundTextContent.get at 19), 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.
+ 762 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 codehealth_rust_sidecar finding(s) in Cyclomatic Complexity — start with main.rs (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 (anonymous) finding(s) in Cyclomatic Complexity — start with kennel-ui.js (3). — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 Model finding(s) in Cyclomatic Complexity — start with main.rs (2). — One of this dimension's main actionable groups (2 warning-level).
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 1358 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 19 codehealth_rust_sidecar finding(s) in Cognitive Complexity — start with main.rs (19). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 4 (anonymous) finding(s) in Cognitive Complexity — start with kennel-ui.js (4). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 Model finding(s) in Cognitive Complexity — start with main.rs (3). — One of this dimension's main actionable groups (3 warning-level).
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.6 / 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.
Resolve the 66 TooManyMethods finding(s) in God Classes — start with AccessibilityAnalyzer.cs, SupplyChainProvenanceAnalyzer.cs, ProductionReadinessAnalyzer.cs. — One of this dimension's main actionable groups (66 warning-level).
Resolve the 62 MethodTooLong finding(s) in God Classes — start with JsDuplicationDetector.cs (4), AccessibilityAnalyzer.cs (4), ProductionReadinessAnalyzer.cs (4). — One of this dimension's main actionable groups (62 warning-level).
Resolve the 60 FileTooLong finding(s) in God Classes — start with SupplyChainProvenanceAnalyzer.cs, AccessibilityAnalyzer.cs, main.rs. — One of this dimension's main actionable groups (60 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
517 duplicated block group(s) detected. A further 43 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 22 of the 560 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 187 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 23 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with CSharpCorrectnessAnalyzer.cs (2), PhpDomainConventions.cs (2), RazorMarkupReferenceScanner.cs. — One of this dimension's main actionable groups (23 warning-level).
Resolve the 23 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with LineBasedGodClassDetector.cs, PnpmLockfileReader.cs, JsDuplicationDetector.cs. — One of this dimension's main actionable groups (23 warning-level).
Resolve the 21 Duplicated block (15 lines × 2) finding(s) in Code Duplication — start with RoslynMethodBody.cs (2), JavaDomainConventions.cs (2), SupplyChainProvenanceAnalyzer.cs (2). — One of this dimension's main actionable groups (21 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.4 / 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.
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.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from coverlet runs or committed reports (Cobertura/OpenCover/lcov), computed per-file with structured exclusions for generated, trivial, and glue code. When the suite can't be built/run in-image AND no report is committed, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 78.5% — read from a committed cobertura report (tools/train/backlog-sessions/01a092f6-f3c2-754f-b7f2-bd802ec4404a/specimen-cobertura-coverage.xml); the in-image collector couldn't run the suite (commonly external-service dependencies). A real measurement, but from a committed artifact rather than a fresh in-image run.
Coverage read from a committed report
✓ On the Gold path — maintain.
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
21106 test methods: 20918 unit, 126 integration, 0 BDD, 62 e2e. The JavaScript/TypeScript suite contributes 323 `it`/`test` case(s) across 43 test file(s) declaring at least one beside 20444 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 71 `#[test]` function(s) across 2 file(s) declaring at least one; its unit/integration split is Cargo's own — 0 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 170 test function(s) across 15 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 56 test case(s) across 7 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 0 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one. The java, swift suite(s) contribute 42 test method(s), read from the language model's own test census — every XCTest `test…` method on an XCTestCase, every swift-testing `@Test` and every JUnit/TestNG `@Test`-annotated method, which is those frameworks' own discovery rule. Their tier split is INFERRED from the test target's name and path only, not declared.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 27599 tests. Measured on the C# suite only — at least 208 test source file(s) (.go, .ts, .py, .mjs, .js, .tsx, .cjs) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
15 outdated, 0 vulnerable, 1 deprecated, 2 prerelease packages. Those are the NuGet packages; this repository's npm dependencies were read too — 5 outdated of 6 package(s) across 5 lockfile(s).
Prerelease dependency: Cai.Delivery · ×2
Deprecated: xunit
Outdated: Markdig · ×15
Outdated (npm): axe-core · ×5
What to do
Resolve the 2 Prerelease dependency finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Deprecated finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Secret scan ran and found no leaked secrets. 26 detection(s) in paths this repository declares as reviewed specimen content (its credential-scanner allowlist) were excluded.
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.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs (146×135=19710); engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs (152×114=17328); engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs (118×144=16992) Repeated repair below the complexity floor: engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs (24 of 40 changes were fixes); engine/src/CodeHealth.Core/CodeShape/DuplicationFinding.cs (14 of 21 changes were fixes); engine/sidecars/tsjs-frontend/main.mjs (12 of 23 changes were fixes)
Resolve the 222 Hotspot finding(s) in Churn × Complexity Hotspots — start with SupplyChainProvenanceAnalyzer.cs, ProductionReadinessAnalyzer.cs, AnalyzeCommand.cs. — One of this dimension's main actionable groups (222 warning-level).
Resolve the 50 Repeated repair finding(s) in Churn × Complexity Hotspots — start with DeepScan.cs, DuplicationFinding.cs, main.mjs. — One of this dimension's main actionable groups (50 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
61 deducted debt markers + 0 dead symbols across 374103 LoC in the .NET projects (0.1/KLoC) → score 9.8.
NoWarnInCsproj — 7 warning codes suppressed in one element · ×24tools/train/backlog-sessions/01a0711e-ee78-732a-9fcd-2b9927957dd6/harness/d35replay.csproj:10
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 24 NoWarnInCsproj finding(s) in Explicit Debt — start with dm6ab.csproj (9), r10replay.csproj (6), sizeprobe.csproj (3). — One of this dimension's main actionable groups (24 issue-level).
Resolve the 11 DemotedWarningsAsErrors finding(s) in Explicit Debt — start with dm6ab.csproj (3), r10replay.csproj (2), noise-probe.csproj. — One of this dimension's main actionable groups (11 issue-level).
Resolve the 3 DisabledAnalyzers finding(s) in Explicit Debt — start with noise-probe.csproj, loc-sweep.csproj, probe-Probe.csproj. — One of this dimension's main actionable groups (3 issue-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
25 projects, 3535 source files, 840468 hand-written lines of code (374103 production / 466365 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), 108 inter-project edges.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
This repository's documentation is exceptionally clear and complete: the README files alone are 1308 words (78 of 1402 XML-doc-covered documents), with a dedicated architecture/Docs markdown tree at 1335 docs, plus an e2e README, qwen-poc README, localdev README, and LLM bake-off README. The content is well-structured into sections such as 'The two apps', 'Structure', 'Run it', 'What each hop proves', and the full outline appears in the body (clipped only by the scanner). It is a single cohesive monorepo documentation set with no gaps or missing elements among the visible documents. This repository is exceptionally well documented for a software project: every major document type (README, architecture/ADR docs, preprod/dgx1 deployment, benchmarks, training metrics) is present and clearly written. The design systems doc explains the shared-skeleton rule with live previews; the benchmarks series grounds broad-noise-rate claims and justifies its non-competitor measurements; ADRs are immutable once accepted and list concrete decisions with consequences; preprod tier details layout, scripts, and why it was phased out; and ground-truth label format is a test-data document that is complete over every scored dimension. The only unshown element is the actual codebase documentation (e.g., how to run the Watchdog benchmark program), which appears clipped. This is a comprehensive set of runtime-evidence specimen builders and language-sidecar READMEs that are each self-contained, well-illustrated with concrete scripts and tables, and document the sidecars' purpose (source-only parsing, NDJSON emission, honest resolution contracts), plus build steps. The engine's own multi-language support is described in depth for each frontend (Scala, Ruby, Python, PHP, Kotlin) with a shared runtime-evidence framework that emits synthetic specimens to exercise the ADR-0014 tier end-to-end.
Documentation: no installation or build instructions · ×4README.md
Resolve the 4 Documentation finding(s) in Documentation Quality — start with README.md (4). — One of this dimension's main actionable groups (4 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR QualityExemplary◐ Sampled · advisory
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
Evaluated 9 ADR(s) individually; mean quality 9.3/10 (consistently complete and clear). 0 flagged with a specific gap.
✓ On the Gold path — maintain.
Detailed fixes: d20_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyExemplary◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.
2 of 25 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
78 % of calls cross a namespace and 4 % go through an interface, but 100 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.
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.
26 finding(s): 0 critical, 26 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
Rotate the exposed credentials — git history can't be un-committed
What to do
Resolve the 23 Secret finding(s) in Secrets (history) — start with corpus.jsonl (4), quality-pairs-v1.jsonl (4), quality-pairs.jsonl (4). — One of this dimension's main actionable groups (23 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
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).
7 finding(s): 0 critical, 2 high, 5 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 792 file(s) — `deploy/assert-preprod-touches-no-prod.sh` (lines 48–98), `deploy/compute-version.sh` (line 74, lines 74–75), `deploy/dgx1/switch-to-bf16-cached.sh` (line 50, line 57), `deploy/dgx1/switch-to-fp8.sh` (line 82), `deploy/dotnet-stale-runtime.sh` (line 133), … (+787 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. In 619 of those file(s) — `engine/src/CodeHealth.Cli/Commands/DimensionsCommand.cs`, `engine/src/CodeHealth.Cli/Commands/RecordingToolRunner.cs`, `engine/src/CodeHealth.Cli/Commands/SpecCommand.cs`, `engine/src/CodeHealth.Cli/Infrastructure/TypeRegistrar.cs`, `engine/src/CodeHealth.Cli/Infrastructure/TypeResolver.cs`, … (+614 more) — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 53 of those file(s) — `engine/src/CodeHealth.Core/Frontend/ForeignLanguageTestRefs.cs`, `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs`, `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs`, `engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs`, `engine/src/CodeHealth.Core/ModelAware/ModelAwareLlmJudge.cs`, … (+48 more) — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 6 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.
High: github-actions-mutable-action-tag · ×2.github/workflows/ci-watchdog.yml:52detected by semgrep finding
Medium: unsafe-path-combine · ×5engine/src/CodeHealth.Core/Testing/NodeBrowserProvision.cs:195detected by semgrep finding
What to do
Resolve the 5 Medium finding(s) in Static Analysis (SAST) — start with NodeBrowserProvision.cs, NodeWorkspaceSiblingBuilder.cs, portfolio-first-scan-parity.cjs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 High finding(s) charged to Static Analysis (SAST) — the other 1 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (2 issue-level, 1 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir/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, Go, Java and Kotlin via Maven/Gradle, 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.
High IaC: DS-0002engine/docker/analyzer/Dockerfiledetected by trivy finding
Medium IaC: WD-DOCKER-0011 · ×2engine/docker/analyzer/Dockerfile:489detected by watchdog IaC rule
What to do
Resolve the 1 High IaC finding(s) in IaC & Container Security — start with Dockerfile. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 2 Medium IaC finding(s) in IaC & Container Security — start with Dockerfile, fixture-service.yaml. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
Every significant source file has living knowledge — recently and meaningfully worked. Counted over 1939 of the 2469 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 4 Change coupling finding(s) in Change Coupling — start with BillingDbContext.cs (2), IMetricsReader.cs, NoiseSplit.cs. — One of this dimension's main actionable groups (4 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with IMetricsWriter.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 1 Unpinned build actions finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No dependency advisory monitoring finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D39 · IL Efficiency9.5 / 10Exemplary✓ Tool-verified
Method: IL instruction count per method, read from the BUILT first-party assemblies via Mono.Cecil (the target is compiled on a deep run); scored on the fraction of methods whose emitted IL body exceeds the size threshold. Sees compiler-generated bloat source can't; not-applicable when the target fails to build. Deterministic.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC1 · Text alternatives10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.
Do you agree with this assessment?
AC2 · Forms & labels7.9 / 10Strong✓ Tool-verified
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. (×7) — src/Kennel.Admin.Core/Admin/Ui/Cohorts.razor:207, src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:47, src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:52, …
What to do
Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
Do you agree with this assessment?
AC3 · Page structure8.0 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.html:2
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: interactive elements plus elements the markup gives a click/key handler or the repo's own CSS styles `cursor: pointer`, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
The repo's own CSS styles .dlv-row with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler. — src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:290
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
Other · Architecture — Whether any singleton service captures a scoped/transient dependency — a silent lifetime/threading bug.
Method: Roslyn scan: DI registrations parsed from AddSingleton/Scoped/Transient; each singleton checked for captured shorter-lifetime dependencies. Exhaustive, deterministic.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. Deterministic, type-level.
`ICodeType` declares 69 members: `Kind`, `IsRecord`, `IsAbstract`, `IsSealed`, `IsStatic`, `IsValueType`, `IsGenericType`, `Name`, `Namespace`, `AssemblyName`, `ProjectName`, `Accessibility`, `TypeParameters`, `BaseType`, `HasMeaningfulBase`, `DirectInterfaces`, `AllInterfaces`, `AllInterfaceRefs`, `Special`, `Location`, `Members`, `UnionCases`, `Attributes`, `EmbeddedTypes`, `UnderlyingType`, `Language`, `FileImports`, `DerivesClause`, `RecoveryFoldCount`, `RecoveryFoldCalls`, `ConstructionCalls`, `CommandCalls`, `BypassConstructions`, `IsOrmRow`, `PrimaryCtorArity`, `OtpBehaviour`, `RestartStrategy`, `SupervisedChildren`, `ErlangEffects`, `ErlangTestOnlyExports`, and 29 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — engine/src/CodeHealth.Core/CodeModel/ICodeType.cs:5
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
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.
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.
Do you agree with this assessment?
C1 · Data Protection10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Do you agree with this assessment?
C3 · Audit Trail10.0 / 10Exemplary✓ Tool-verified
Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.
C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
Other · Domain Modelling — Whether aggregates reference each other by identity (id) rather than by direct object reference — the core DDD consistency-boundary rule.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Do you agree with this assessment?
DM10 · One transaction, one aggregate10.0 / 10Exemplary○ Nothing flagged
Other · Domain Modelling — Whether a single operation mutates more than one aggregate root. An aggregate is a consistency boundary, so saving two together fuses them into one — the second's invariants come to depend on the first's transaction, and the pair can no longer be separated. Reads of other aggregates are not counted.
Method: Neutral body surface (DDD-gated): every method body scanned for repository WRITE calls (Add/Update/Save/Remove/Delete/Insert/Store and their async forms), keyed on the ARGUMENT type rather than the repository type — three `IRepository<T>` writes collapse to one repository but are three distinct aggregates. Reads (Get/Find/Load/Query) are excluded, so loading another aggregate for context never counts. Score is offending methods over methods that write at all. Deterministic.
Other · Domain Modelling — Whether an aggregate can be constructed in a state its own rules forbid — a public constructor that takes a raw primitive, stores it, and validates nothing, with no factory beside it. A constructor taking only value objects is not counted: each parameter has already validated itself.
Method: Neutral surface (DDD-gated): each non-abstract entity/aggregate checked for a PUBLIC constructor taking at least one RAW PRIMITIVE parameter whose body contains no guard token (throw / Guard. / Ensure. / ArgumentException / CheckRule), on a type that also offers no static Create/Of/From/New factory. A constructor taking only value objects is never charged -- measured: 64 of 87 unguarded public constructors on the C# corpus take value objects only, so ignoring parameter types would be 73% false positives. One finding per entity. Deterministic.
Other · Domain Modelling — Whether entities protect their state — private/init-only setters, and collections handed out as read-only views rather than the mutable backing collection — instead of exposing writable state that bypasses invariants. Softened when a rehydration framework (Marten/EF) is present.
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.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies (EF/Marten/HTTP/ASP.NET) — the clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Other · Domain Modelling — Whether clusters of primitives that travel together (a missing value object) are extracted — a low-weight suggestion, LLM-confirmed when configured.
Method: Roslyn (DDD-gated): primitive parameter clusters recurring three or more times across signatures extracted, then confirmed by language model when configured. Advisory, low-weight.
Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.
Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.
(int Passed, int Failed)'s [Failed, Passed] are judged in CodeHealth.Core.Testing.DotnetTestReliabilityCollector, CodeHealth.Core.Testing.NodeTestReliabilityCollector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
(int Start, int End)'s [End, Start] are judged in CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RoslynDuplicationDetector.CoalescedRegion, CodeHealth.Core.ExplicitDebt.RazorGeneratedDocumentSynthesizer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.CodeModel.IProperty's [Setter, SetterAccessibility] are judged in CodeHealth.Core.ModelAware.DartDomainConventions, CodeHealth.Core.ModelAware.DomainConventions, CodeHealth.Core.ModelAware.DomainModelAnalyzer, CodeHealth.Core.ModelAware.EventSourcingAnalyzer, CodeHealth.Core.ModelAware.KotlinDomainConventions, CodeHealth.Core.ModelAware.PythonDomainConventions, CodeHealth.Core.ModelAware.SwiftDomainConventions, CodeHealth.Core.ModelAware.SymbolHelpers — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.CodeModel.TypeKind's [Class, Record] are judged in CodeHealth.Core.ModelAware.DomainModelAnalyzer, CodeHealth.Core.ModelAware.SwiftDomainConventions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.CodeShape.CloneMemberExtent's [EndLine, StartLine] are judged in CodeHealth.Core.CodeShape.ChainedCorrespondence, CodeHealth.Core.CodeShape.ChainedFamilyRollup, CodeHealth.Core.CodeShape.MemberFamilyRollup, CodeHealth.Core.CodeShape.MemberPairRollup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.CodeShape.DuplicationLocation's [EndLine, StartLine] are judged in CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RoslynDuplicationDetector.CoalescedRegion, CodeHealth.Core.Frontend.JsDuplicationDetector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsConstantOnlyField.ClassBody's [BodyClose, BodyOpen] are judged in CodeHealth.Core.Frontend.JsConstantOnlyField, CodeHealth.Core.Frontend.JsConstantOnlyField.PropertyWrite — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsFunctionUnit's [BodyTokenEnd, BodyTokenStart] are judged in CodeHealth.Core.Complexity.FirstPartyJsComplexity, CodeHealth.Core.Frontend.JsComplexity — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsToken's [Kind, Text] are judged in CodeHealth.Core.Frontend.FrontendTestReachability, CodeHealth.Core.Frontend.JsConstantOnlyField, CodeHealth.Core.Frontend.JsDuplicationDetector, CodeHealth.Core.Frontend.JsScopeBindings — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsTokenKind's [Identifier, Keyword] are judged in CodeHealth.Core.Frontend.ExportUsageSolver, CodeHealth.Core.Frontend.JsScopeBindings, CodeHealth.Core.Frontend.JsToken, CodeHealth.Core.Frontend.ModuleSyntaxScanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsTokenKind's [StringLiteral, TemplateString] are judged in CodeHealth.Core.Frontend.FrontendEngine, CodeHealth.Core.Frontend.ModuleSyntaxScanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Frontend.JsTokenKind's [Identifier, Punctuator] are judged in CodeHealth.Core.Frontend.JsDuplicationDetector, CodeHealth.Core.Markup.JsxMarkupProducer, CodeHealth.Core.Markup.JsxMarkupProducer.Walker — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
Microsoft.CodeAnalysis.ITypeSymbol's [SpecialType, TypeKind] are judged in CodeHealth.Core.ModelAware.CSharpCorrectnessAnalyzer, CodeHealth.Core.ModelAware.JsInteropContractAnalyzer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.Collections.Generic.List<int>'s [Count, this[]] are judged in CodeHealth.Core.Frontend.JsLexer, CodeHealth.Core.Frontend.JsLexer.Scanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.ReadOnlySpan<char>'s [Length, this[]] are judged in CodeHealth.Core.CodeShape.NeutralFileLengthScanner, CodeHealth.Core.ExplicitDebt.SourceCommentTaskScanner, CodeHealth.Core.Scoring.DiskSourceFiles — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.Text.Json.JsonValueKind's [Object, String] are judged in CodeHealth.Core.Dependencies.NpmRegistryClient, CodeHealth.Core.Dependencies.OsvAdvisoryClient, CodeHealth.Core.Dependencies.RubyGemsRegistryClient, CodeHealth.Core.Dependencies.UnityRegistryClient, CodeHealth.Core.Frontend.FrontendManifestEntryPoints, CodeHealth.Core.Frontend.FrontendManifestParsing, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.Readiness.ProductionReadinessAnalyzer, CodeHealth.Core.Testing.CommittedCoverageReader, CodeHealth.Core.Testing.NodeTestSuiteProbe, CodeHealth.Core.Testing.NodeWorkspaceSiblingBuilder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.Text.Json.JsonValueKind's [Array, Object] are judged in CodeHealth.Core.Frontend.FrontendManifestEntryPoints, CodeHealth.Core.Frontend.FrontendManifestParsing, CodeHealth.Core.Frontend.FrontendWorkspaceLoader, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.Security.SyftSbomNormalizer, CodeHealth.Core.Testing.CommittedCoverageReader — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.Text.StringBuilder's [Length, this[]] are judged in CodeHealth.Core.Markup.TaggedTemplateMarkupProducer, CodeHealth.Core.Markup.TaggedTemplateMarkupProducer.Template, CodeHealth.Core.Markup.TemplMarkupProducer, CodeHealth.Core.Markup.TemplateLanguageMarkupProducer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
string's [Length, this[]] are judged in CodeHealth.Core.ApiSurface.ApiSurfaceExtractor, CodeHealth.Core.ApiSurface.CSharpSourceScanner, CodeHealth.Core.ApiSurface.RouteTemplateNormalizer, CodeHealth.Core.Classification.RustInlineTestModule, CodeHealth.Core.CodeShape.GoRawStringRegions, CodeHealth.Core.CodeShape.NeutralFileLengthScanner, CodeHealth.Core.CodeShape.NeutralMethodLengthScanner, CodeHealth.Core.CodeShape.PolyglotConditionScanner, CodeHealth.Core.CodeShape.RazorCodeVirtualizer, CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RustInlineTestRegions, CodeHealth.Core.CodeShape.RustInlineTestRegions.LineLexer, CodeHealth.Core.Cohesion.Lcom4Calculator, CodeHealth.Core.Compliance.PiiDataMapAnalyzer, CodeHealth.Core.Dart.DartDeadLibraryField, CodeHealth.Core.Dart.DartRepositoryIdentifiers, CodeHealth.Core.Dependencies.MavenVersion, CodeHealth.Core.Dependencies.NpmManifestHygiene, CodeHealth.Core.Dependencies.PnpmLockfileReader, CodeHealth.Core.Dependencies.SwiftPackageHygiene, CodeHealth.Core.Discovery.FrontendAnalyzer, CodeHealth.Core.Discovery.FrontendSourcePresence, CodeHealth.Core.Discovery.UnityProjectPresence, CodeHealth.Core.ExplicitDebt.AttributeConsumptionScanner, CodeHealth.Core.ExplicitDebt.RazorCodeBlockProjection, CodeHealth.Core.ExplicitDebt.RazorGeneratedDocumentSynthesizer, CodeHealth.Core.ExplicitDebt.ReflectiveDiscoveryScanner, CodeHealth.Core.ExplicitDebt.RoslynDeadCodeDetector, CodeHealth.Core.ExplicitDebt.RoslynExplicitDebtCollector, CodeHealth.Core.FileQuality.GeneratedCodePolicy, CodeHealth.Core.Frontend.EntryPointCatalog, CodeHealth.Core.Frontend.FrontendBoundaries, CodeHealth.Core.Frontend.FrontendDeadCode, CodeHealth.Core.Frontend.FrontendDeclaredPackageRefs, CodeHealth.Core.Frontend.FrontendDependencyHygiene, CodeHealth.Core.Frontend.FrontendEngine, CodeHealth.Core.Frontend.FrontendEngineDimensions, CodeHealth.Core.Frontend.FrontendMarkupRefs, CodeHealth.Core.Frontend.FrontendPathLiteralRefs, CodeHealth.Core.Frontend.FrontendSpecifierScanning, CodeHealth.Core.Frontend.FrontendTestReachability, CodeHealth.Core.Frontend.FrontendTestSuiteMasking, CodeHealth.Core.Frontend.JsLexer, CodeHealth.Core.Frontend.JsLexer.Scanner, CodeHealth.Core.Frontend.JsScopeBindings, CodeHealth.Core.Frontend.JsStringConstants, CodeHealth.Core.Frontend.MinifiedJsHeuristics, CodeHealth.Core.Frontend.ModuleGlobPattern, CodeHealth.Core.Frontend.ModuleResolver, CodeHealth.Core.Frontend.ModuleSyntaxScanner, CodeHealth.Core.Frontend.NonProductionPaths, CodeHealth.Core.Frontend.NonProductionTreeReadmission, CodeHealth.Core.Frontend.PlatformSubstitutionTable, CodeHealth.Core.Frontend.TsConfigFacts, CodeHealth.Core.Frontend.TsConfigGlob, CodeHealth.Core.Markup.AstroMarkupProducer, CodeHealth.Core.Markup.IndentedMarkupProducer, CodeHealth.Core.Markup.MarkupParser, CodeHealth.Core.Markup.TemplateLanguageMarkupProducer, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.ModelAware.AccessibilityAnalyzer, CodeHealth.Core.ModelAware.DomainConventions, CodeHealth.Core.ModelAware.GoDomainConventions, CodeHealth.Core.ModelAware.HeadingLabelQualityAnalyzer, CodeHealth.Core.ModelAware.IncompletenessAnalyzer, CodeHealth.Core.ModelAware.LogicDefectAnalyzer, CodeHealth.Core.ModelAware.PerformanceAnalyzer, CodeHealth.Core.ModelAware.RubyDomainConventions, CodeHealth.Core.ModelAware.SupplyChainHygieneAnalyzer, CodeHealth.Core.Readiness.CiWorkflowReader, CodeHealth.Core.Readiness.PipelineVersionOutputScan, CodeHealth.Core.Readiness.VacuousFormatGate, CodeHealth.Core.Scoring.CiGateDetection, CodeHealth.Core.Scoring.CompileRemovedPaths, CodeHealth.Core.Security.NativeSecretScanner, CodeHealth.Core.Testing.CompileExcludedTestFiles, CodeHealth.Core.Testing.GoTestCensus, CodeHealth.Core.Testing.JsTestCensus, CodeHealth.Core.Testing.JsTestQualityCensus, CodeHealth.Core.Testing.PythonTestCensus, CodeHealth.Core.Testing.RustTestCensus — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
CodeHealth.Core.Dimensions.DimensionResult's [AchievedRung, CeilingRung] are judged in CodeHealth.Reporting.Recommendations.RuleRecommendationEngine, CodeHealth.Reporting.Scorecard.ScorecardJsonRenderer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
System.Collections.Generic.List<string>'s [Count, this[]] are judged in CodeHealth.Dimensions.Security.Scanners.MutableGitCloneScan, CodeHealth.Dimensions.Security.Scanners.UnpinnedToolchainInstallScan, CodeHealth.Dimensions.Security.SupplyChainProvenanceAnalyzer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
What to do
Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
Other · Event Sourcing — Whether Apply/When folds reconstruct state purely from the event (no DateTime.Now, Guid.NewGuid, Random or IO) so replay is reproducible.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether persisted events are immutable facts (init-only/readonly) — a settable event member lets stored history be rewritten.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Do you agree with this assessment?
ES3 · PII in the event store10.0 / 10Exemplary○ Nothing flagged
Other · Event Sourcing — Whether the append-only event log avoids un-erasable personal data (or has a crypto-shredding strategy) — a GDPR right-to-erasure risk.
Method: Roslyn (event-sourcing gated): high-confidence PII flagged Warning; ambiguous name-like fields adjudicated by language model as person versus fictional. Advisory without model, definitive with.
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.
A placeholder string ("Is this heading or label TEXT a non-desc…") is still in shipped code — typical of generated boilerplate that was never filled in. — engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121
A placeholder string ("lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in. (×9) — engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:229, engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:329, engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:339, …
A placeholder string ("change_me") is still in shipped code — typical of generated boilerplate that was never filled in. (×3) — engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151, engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:64, engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758
A placeholder string ("replaceme") is still in shipped code — typical of generated boilerplate that was never filled in. (×3) — engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151, engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:139, engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758
A placeholder string ("replace_me") is still in shipped code — typical of generated boilerplate that was never filled in. (×2) — engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151, engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758
A placeholder string ("(?ix) <[^>]*>
| \b firstna…") is still in shipped code — typical of generated boilerplate that was never filled in. — engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:97
A placeholder string ("_change_me") is still in shipped code — typical of generated boilerplate that was never filled in. — engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3759
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers). (×6) — engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1334, engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1335, engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1117, …
A placeholder value ("Is this heading or label TEXT a non-desc…") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121
A placeholder value ("john doe") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
A placeholder value ("jane doe") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
A placeholder value ("john smith") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
A placeholder value ("foo bar") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
A placeholder value ("lorem ipsum") is still in shipped code — sample/mock data that was never replaced with the real thing. — engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142
What to do
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 25 of 25 project(s) that lack one — worth up to 2 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries. Exhaustive, deterministic.
Only 17/20 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 20, 2 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
What to do
Extend structured logging across the projects you operate, and give the library ones a diagnostics seam instead — an `EventSource`/`ActivitySource` the host can subscribe to, or an optional logger on your options object — rather than taking a logging dependency on your consumers' behalf.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
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.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
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.
Do you agree with this assessment?
P9 · Domain vs controller coverage7.3 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether test coverage concentrates on the domain (business rules) rather than the trivial web/controller layer — a focus check a generic tool can't make.
Method: Roslyn plus test-execution analysis: domain-layer versus trivial web/controller coverage ratio. Computed metric, deterministic.
What to do
Raise domain coverage toward 100% — cover the remaining aggregates / value objects / domain services where the business invariants and costly bugs live.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Raise allocation-aware density on the hot paths — currently 869 use(s) across 378,861 production line(s) (~2.3/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) that wastes threads and risks deadlock, and, where the code is a reusable library, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking (.Wait()/.GetAwaiter().GetResult()) counted everywhere, and — for a library with ≥5 awaits — the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
R1 · Type Safety8.0 / 10Strong✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
engine/docker/analyzer/render/axe-render.mjs:227 · engine/docker/analyzer/render/observe-proxy.mjs:89 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — engine/docker/analyzer/render/axe-render.mjs:227
tools/localdev/ui/corpus-e2e.mjs:891 · tools/localdev/ui/corpus-e2e.mjs:904 — the two spans are one implementation copied and then locally edited — 86 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — tools/localdev/ui/corpus-e2e.mjs:891
engine/docker/analyzer/render/observe-proxy.mjs:88 · tools/localdev/ui/lib/cli.mjs:23 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — engine/docker/analyzer/render/observe-proxy.mjs:88
engine/sidecars/ruby-frontend/body-facts.mjs:129 · engine/sidecars/ruby-frontend/file-extractor.mjs:191 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — engine/sidecars/ruby-frontend/body-facts.mjs:129
engine/sidecars/ruby-frontend/project.mjs:39 · engine/sidecars/ruby-frontend/project.mjs:51 — the two spans are one implementation copied and then locally edited — 53 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — engine/sidecars/ruby-frontend/project.mjs:39
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
main has cyclomatic complexity 43 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:739
inspect has cyclomatic complexity 24 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:536
walk has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:455
(anonymous) has cyclomatic complexity 14 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/e2e/compliance-scope-parity.cjs:28
(anonymous) has cyclomatic complexity 14 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/e2e/repo-hub-hover.cjs:36
stripStringsAndComments has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — engine/sidecars/tsjs-frontend/ts-helpers.mjs:106
walk has cyclomatic complexity 12 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — engine/sidecars/tsjs-frontend/ts-helpers.mjs:264
main has cyclomatic complexity 12 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/a11y-gate.mjs:146
walk has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:649
methodMember has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — engine/sidecars/ruby-frontend/members.mjs:15
looksMinified has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — engine/sidecars/tsjs-frontend/ts-helpers.mjs:147
judgeShare has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:176
(anonymous) has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:352
parseCsv has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — tools/localdev/ui/corpus-e2e.mjs:675
typeRefOfNode has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — engine/sidecars/tsjs-frontend/extract-file.mjs:130
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files6.8 / 10Adequate✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
3 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: tools/localdev/ui/corpus-e2e.mjs (849), engine/sidecars/tsjs-frontend/ts-helpers.mjs (540), engine/sidecars/tsjs-frontend/extract-file.mjs (528).
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage9.5 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×2) — tools/train/backlog-sessions/01a09ba7-5207-791d-a102-a79db2fa205c/fixture-slice.ts, tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.mjs
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.8 / 10Exemplary✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
8 file(s) (~785 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — engine/docker/analyzer/render
Unreachable from the 39 application, 13 tooling and 149 test entry point(s) detected in this repo. Gate removals on `npm run typecheck` — an undetected custom entry would make these reachable.
no import path from any entry point (39 application, 13 tooling, 149 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — tools/train/backlog-sessions/01a09ba7-5207-791d-a102-a79db2fa205c/fixture-slice.ts, tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.mjs
Nothing imports this binding — it is safe to review for removal. (×2) — engine/sidecars/tsjs-frontend/constants.mjs:128, engine/sidecars/tsjs-frontend/constants.mjs:132
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Transport security, security headers, secure cookies, input validation, middleware order and crypto hygiene (presence, not runtime).
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. Deterministic, provable per finding. Advisory.
`workspace` is a `AdhocWorkspace`, which implements `IDisposable`, and it is created here (line 233). Every use of it in `Build` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var workspace = …;`), which releases it at the end of the scope on every path including a throw. — engine/src/CodeHealth.Core/Roslyn/BuildlessCSharpProjects.cs:233
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage.
Only 346/379 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — this work can't be stopped early once started. (×26) — engine/src/CodeHealth.Core/Architecture/BoundedContextResolver.cs:233, engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:193, engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1156, …
No CancellationToken parameter — the body observes an ambient token instead (a field or a context object), so the work does stop on cancellation, but a caller cannot cancel this call independently of the owner that created that token. (×7) — engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs:159, engine/src/CodeHealth.Toolchain/Git/GitDiffShapes.cs:478, engine/src/CodeHealth.Toolchain/Git/GitLogHistoryExtractor.cs:253, …
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. Deterministic.
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.
This method contradicts itself about `unreadStrings`: line 7186 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 7221 then dereferences `unreadStrings` as `unreadStrings.Examples` AFTER the block has closed, where the guard no longer applies. A null `unreadStrings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `unreadStrings` truly cannot be null by then, the guard above is misleading and should go. — engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7221
This method contradicts itself about `model`: line 162 writes `model?.`, which says `model` can be null, but line 163 then dereferences it directly as `model.CloneUnits` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `model` truly cannot be null here, the `?.` is misleading. Settle it one way — test `model` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:163
~0.3 `!` suppressions per 1k syntax nodes — 413 suppression(s) across the 1501958 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
What to do
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Where a method null-tests a symbol and then uses it after the guarded block closes, move the trailing work inside the block — the guard skips its body on null, it does not stop the method.
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 5 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X31 Test-only surface in a production module — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 13 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.
X9 Subsumed condition operand — 23 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not included — 24 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.
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.
D11 Test Reliability — Test reliability not measured — polyglot suite, one half not re-run
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D21 Naming Consistency — LLM evaluation failed
D23 Boundary Type-Coupling — Cross-context type coupling was not assessed: no type reached this dimension's context map.
D25 ADR Conformance — none of 9 ADRs are conformance-checkable — unverifiable.
D32 Data Compliance (PII/GDPR) — 713 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
DM12 Ambient inputs in the domain — no domain-layer types detected — ambient-input check not applicable
DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
DM4 Rich vs anemic model — no data-bearing entities detected — rich-vs-anemic model not assessable
DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, which this analysis does not build from source alone for this language. Reported as guidance rather than measured
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
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HttpClient/IHttpClientFactory/AddHttpClient in source, and no Refit/RestSharp/Flurl.Http namespace or package reference
P8 Schema migrations — no EF Core usage detected
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
SC1 Supply-chain hygiene — 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.
NoWarnInCsproj — 7 warning codes suppressed in one element tools/train/backlog-sessions/01a0711e-ee78-732a-9fcd-2b9927957dd6/harness/d35replay.csproj:10— A single <NoWarn> suppresses 7 warning codes (CS1591;CA1305;CA1307;CS8600;CS8602;CS8604;CS8605) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj tools/train/backlog-sessions/01a080f8-419a-7d18-916b-4bd2bbf18927/probe-Probe.csproj:8— CS8618 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080f8-419a-7d18-916b-4bd2bbf18927/probe-Probe.csproj:8— CA1852 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e22-7957-7dd1-8c61-e313dbdb17fb/harness/sizeprobe.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e20-5cea-736e-967d-bc957889e676/harness/r10replay.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080b5-9ab2-7452-9384-b5d68b1122d3/harness/dm12ab.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080aa-ee06-7fd0-9c46-8623acd96890/harness/dm6ab.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a08091-e938-76af-8e54-2628bae0fd2c/harness/dm6ab.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a07fdf-6e55-7703-845c-528f7b401fab/harness/dm6ab.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a071a1-6fdf-7a1c-99d4-430f6bdb4599/harness/r10replay.csproj:10— CS1591 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e22-7957-7dd1-8c61-e313dbdb17fb/harness/sizeprobe.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e20-5cea-736e-967d-bc957889e676/harness/r10replay.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080b5-9ab2-7452-9384-b5d68b1122d3/harness/dm12ab.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080aa-ee06-7fd0-9c46-8623acd96890/harness/dm6ab.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a08091-e938-76af-8e54-2628bae0fd2c/harness/dm6ab.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a07fdf-6e55-7703-845c-528f7b401fab/harness/dm6ab.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a071a1-6fdf-7a1c-99d4-430f6bdb4599/harness/r10replay.csproj:10— CA1305 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e22-7957-7dd1-8c61-e313dbdb17fb/harness/sizeprobe.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a09e20-5cea-736e-967d-bc957889e676/harness/r10replay.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080b5-9ab2-7452-9384-b5d68b1122d3/harness/dm12ab.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a080aa-ee06-7fd0-9c46-8623acd96890/harness/dm6ab.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a08091-e938-76af-8e54-2628bae0fd2c/harness/dm6ab.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a07fdf-6e55-7703-845c-528f7b401fab/harness/dm6ab.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
NoWarnInCsproj tools/train/backlog-sessions/01a071a1-6fdf-7a1c-99d4-430f6bdb4599/harness/r10replay.csproj:10— CA1307 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
Secret: aws-access-token engine/docker/analyzer/Dockerfile @ 82d4312:371 (committed 2026-08-27)— gitleaks matched rule 'aws-access-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: aws-secret-key engine/docker/analyzer/Dockerfile @ 82d4312:372 (committed 2026-08-27)— gitleaks matched rule 'aws-secret-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: stripe-access-token engine/docs/rulesets/secret-env-literal-fallback-gate.js.txt @ e8a88a1:28 (committed 2026-09-14)— gitleaks matched rule 'stripe-access-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs @ ada79cd:103 (committed 2026-08-28)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs @ 4291ee3:26 (committed 2026-08-28)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs @ 4291ee3:30 (committed 2026-08-28)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key engine/src/CodeHealth.Dimensions.Security/Scanners/TextSentinelConstantIndex.cs @ c82a646:16 (committed 2026-09-04)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-app-token tools/llm-bakeoff/corpus.jsonl @ 33841c8:22 (committed 2026-09-05)— gitleaks matched rule 'github-app-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-oauth tools/llm-bakeoff/corpus.jsonl @ 33841c8:22 (committed 2026-09-05)— gitleaks matched rule 'github-oauth' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-pat tools/llm-bakeoff/corpus.jsonl @ 33841c8:22 (committed 2026-09-05)— gitleaks matched rule 'github-pat' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-refresh-token tools/llm-bakeoff/corpus.jsonl @ 33841c8:22 (committed 2026-09-05)— gitleaks matched rule 'github-refresh-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-app-token tools/llm-bakeoff/quality-pairs-v1.jsonl @ 33841c8:28 (committed 2026-09-05)— gitleaks matched rule 'github-app-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-oauth tools/llm-bakeoff/quality-pairs-v1.jsonl @ 33841c8:28 (committed 2026-09-05)— gitleaks matched rule 'github-oauth' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-pat tools/llm-bakeoff/quality-pairs-v1.jsonl @ 33841c8:28 (committed 2026-09-05)— gitleaks matched rule 'github-pat' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-refresh-token tools/llm-bakeoff/quality-pairs-v1.jsonl @ 33841c8:28 (committed 2026-09-05)— gitleaks matched rule 'github-refresh-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-app-token tools/llm-bakeoff/quality-pairs.jsonl @ 33841c8:25 (committed 2026-09-05)— gitleaks matched rule 'github-app-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-oauth tools/llm-bakeoff/quality-pairs.jsonl @ 33841c8:25 (committed 2026-09-05)— gitleaks matched rule 'github-oauth' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-pat tools/llm-bakeoff/quality-pairs.jsonl @ 33841c8:25 (committed 2026-09-05)— gitleaks matched rule 'github-pat' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: github-refresh-token tools/llm-bakeoff/quality-pairs.jsonl @ 33841c8:25 (committed 2026-09-05)— gitleaks matched rule 'github-refresh-token' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key tools/train/backlog-sessions/01a081d5-6746/unit-mine.log @ 772b8e9:788 (committed 2026-09-08)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key tools/train/backlog-sessions/01a081d5-6746/unit-mine.log @ 772b8e9:1520 (committed 2026-09-08)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: http-authorization-credential tools/train/backlog-sessions/01a081d5-6746/unit-mine.log @ 772b8e9:3674 (committed 2026-09-08)— gitleaks matched rule 'http-authorization-credential' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
Secret: generic-api-key tools/train/prompts/D13-leaked-secret.txt @ 8e853d7:30 (committed 2026-09-07)— gitleaks matched rule 'generic-api-key' here, in git history. Deleting the file does not remove it — the commit persists on every clone, fork and backup — so the act is to ROTATE this credential and treat it as compromised. The "Rotate the exposed credentials" row carries the full procedure, including when a `.gitattributes` provenance declaration is the correct answer instead.
DemotedWarningsAsErrors engine/tools/noise-probe/noise-probe.csproj:16— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors engine/tools/loc-sweep/loc-sweep.csproj:17— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a080f8-419a-7d18-916b-4bd2bbf18927/probe-Probe.csproj:11— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a09e22-7957-7dd1-8c61-e313dbdb17fb/harness/sizeprobe.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a09e20-5cea-736e-967d-bc957889e676/harness/r10replay.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a080b5-9ab2-7452-9384-b5d68b1122d3/harness/dm12ab.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a080aa-ee06-7fd0-9c46-8623acd96890/harness/dm6ab.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a08091-e938-76af-8e54-2628bae0fd2c/harness/dm6ab.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a07fdf-6e55-7703-845c-528f7b401fab/harness/dm6ab.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a071a1-6fdf-7a1c-99d4-430f6bdb4599/harness/r10replay.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
DemotedWarningsAsErrors tools/train/backlog-sessions/01a0711e-ee78-732a-9fcd-2b9927957dd6/harness/d35replay.csproj:12— TreatWarningsAsErrors — this repository turns the warnings-are-errors gate ON in a scope above this line, and this entry switches it back OFF: from here down, no warning fails the build. That is broader than any suppression list — it is not one rule silenced but every rule, present and future, stopped from gating, for every project under this scope and for code nobody has written yet. Warnings keep being printed, so nothing looks switched off, and the only record of the decision is this line, which a reader of the code below has no reason to open. Fix what the build is reporting here and delete the entry so the scope rejoins the gate, or — where this scope really is allowed to warn (generated code, throwaway benchmarks) — name the codes it is allowed to warn about instead of standing the whole gate down, so the exception stays reviewable and the rest keeps protecting you. If the demotion is genuinely correct as it is, say why in a comment above it: that is what turns it from unexplained debt into a recorded decision, and it clears this row.
AC2 · Forms & labels· <label> that labels no control · ×7
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/Cohorts.razor:207— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:47— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:52— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:57— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/PricingAssay.razor:62— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Admin.Core/Admin/Ui/Questionnaires.razor:216— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
<label> that labels no control src/Kennel.Core/Accounts/Ui/Settings.razor:61— This <label> has no for and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label for="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
DisabledAnalyzers engine/tools/noise-probe/noise-probe.csproj:15— EnableNETAnalyzers — this does not switch a rule off, it stops the analyzers running for the whole project: every rule they ship is silenced at once, including every rule added by a future upgrade, and nothing at the sites they would have reported records that anything was switched off. There is no code here to look up and nothing to weigh, which is what makes it the one suppression that is never revisited. Turn the analyzers back on and deal with what they report — suppressing the handful of rules that are genuinely unwanted, each on its own line with its reason, keeps the rest protecting the project and leaves a record a reader can audit.
DisabledAnalyzers engine/tools/loc-sweep/loc-sweep.csproj:16— EnableNETAnalyzers — this does not switch a rule off, it stops the analyzers running for the whole project: every rule they ship is silenced at once, including every rule added by a future upgrade, and nothing at the sites they would have reported records that anything was switched off. There is no code here to look up and nothing to weigh, which is what makes it the one suppression that is never revisited. Turn the analyzers back on and deal with what they report — suppressing the handful of rules that are genuinely unwanted, each on its own line with its reason, keeps the rest protecting the project and leaves a record a reader can audit.
DisabledAnalyzers tools/train/backlog-sessions/01a080f8-419a-7d18-916b-4bd2bbf18927/probe-Probe.csproj:10— RunAnalyzers — this does not switch a rule off, it stops the analyzers running for the whole project: every rule they ship is silenced at once, including every rule added by a future upgrade, and nothing at the sites they would have reported records that anything was switched off. There is no code here to look up and nothing to weigh, which is what makes it the one suppression that is never revisited. Turn the analyzers back on and deal with what they report — suppressing the handful of rules that are genuinely unwanted, each on its own line with its reason, keeps the rest protecting the project and leaves a record a reader can audit.
High: github-actions-mutable-action-tag .github/workflows/ci-watchdog.yml:52— GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. `uses: actions/checkout@<40-character SHA>`. This step references `actions/checkout@v4`; resolve the SHA it points at today with `gh api repos/actions/checkout/commits/v4 --jq .sha`.
High: run-shell-injection .github/workflows/ci-watchdog.yml:57— Using variable interpolation `${{...}}` with `github` context data in a `run:` step could allow an attacker to inject their own code into the runner. This would allow them to steal secrets and code. `github` context data can have arbitrary user input and should be treated as untrusted. Instead, use an intermediate environment variable with `env:` to store the data and use the environment variable in the `run:` script. Reference it as a shell VARIABLE rather than a `${{ }}` interpolation, using your shell's own syntax (`"$ENVVAR"` in bash, `$env:ENVVAR` in PowerShell), so the value is passed as data and never re-expanded as code.
AC4 · Keyboard semantics· Clickable element isn't keyboard-operable · ×1
Clickable element isn't keyboard-operable src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:290— The repo's own CSS styles .dlv-row with `cursor: pointer`, so this <div> is a control — but it has no role, no tabindex="0" and no key handler, so it can only be reached with a mouse. Use a <button>, or add role + tabindex="0" + a key handler.
WriteOnlyPrivateField engine/src/CodeHealth.Toolchain/Isolation/ScratchCeiling.cs:168— private Task _loop — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
High IaC: DS-0002 engine/docker/analyzer/Dockerfile— Image user should not be 'root'. Specify at least 1 USER command in Dockerfile with non-root user as argument. Add 'USER <non root user name>' line to the Dockerfile. A container that starts as root runs your process with root's capabilities inside the namespace, so a compromise of the process starts from there. The step: create an unprivileged account in the image (`RUN adduser --system --no-create-home app`), give it ownership of the paths the process writes at runtime (`COPY --chown=` on those layers, or a `RUN chown -R`), and end the final stage with `USER app` so it is the default at start. Build stages that only compile can stay root; it is the stage that RUNS that needs the account. If the process genuinely requires root — it manages the container runtime, ptraces another process or opens raw devices — say so here rather than making a change that breaks it.
Hotspot: engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2625— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs changed 146 times in last 90 days, max cyclomatic complexity 135 in SupplyChainProvenanceAnalyzer.RunAsync at line 2625. 39 of those changes were fix/bug commits, and the other 107 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4675— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs changed 152 times in last 90 days, max cyclomatic complexity 114 in ProductionReadinessAnalyzer.SecurityAndPerf at line 4675. 42 of those changes were fix/bug commits, and the other 110 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:171— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs changed 118 times in last 90 days, max cyclomatic complexity 144 in AnalyzeCommand.ExecuteCoreAsync at line 171. 51 of those changes were fix/bug commits, and the other 67 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:130— engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs changed 57 times in last 90 days, max cyclomatic complexity 252 in DependencyHygieneAnalyzer.RunAsync at line 130. 20 of those changes were fix/bug commits, and the other 37 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6348— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs changed 116 times in last 90 days, max cyclomatic complexity 105 in AccessibilityAnalyzer.AssessEnforcement at line 6348. 47 of those changes were fix/bug commits, and the other 69 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:860— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs changed 87 times in last 90 days, max cyclomatic complexity 102 in JsDuplicationDetector.BuildDeclarationEntryMask at line 860. 55 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs:293— engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs changed 83 times in last 90 days, max cyclomatic complexity 94 in SemgrepClaimRecheck.PremiseRefutedByTheCitedSource at line 293. 34 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:27— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs changed 60 times in last 90 days, max cyclomatic complexity 130 in CSharpCorrectnessAnalyzer.AnalyzeAsync at line 27. 11 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5493— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs changed 57 times in last 90 days, max cyclomatic complexity 128 in ComplianceSecurityAnalyzer.S1 at line 5493. 11 of those changes were fix/bug commits, and the other 46 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:881— engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs changed 71 times in last 90 days, max cyclomatic complexity 97 in MaturityAnalyzer.FolderStructure at line 881. 22 of those changes were fix/bug commits, and the other 49 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3346— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs changed 104 times in last 90 days, max cyclomatic complexity 53 in ChangeCouplingAnalyzer.HasExplicitDependency at line 3346. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:897— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs changed 44 times in last 90 days, max cyclomatic complexity 119 in SecretsHistoryAnalyzer.GateCorpusAndDocumentedExampleFindings at line 897. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Classification/SourceClassifier.cs engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3231— engine/src/CodeHealth.Core/Classification/SourceClassifier.cs changed 70 times in last 90 days, max cyclomatic complexity 74 in SourceClassifier.EcosystemMarkerVerdict at line 3231. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Classification/SourceClassifier.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:524— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs changed 75 times in last 90 days, max cyclomatic complexity 67 in RoslynDuplicationDetector.ScanAsync at line 524. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:146— engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs changed 64 times in last 90 days, max cyclomatic complexity 76 in IncompletenessAnalyzer.AnalyzeAsync at line 146. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs:65— engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs changed 58 times in last 90 days, max cyclomatic complexity 79 in CoverageAnalyzer.RunAsync at line 65. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:25— engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs changed 61 times in last 90 days, max cyclomatic complexity 73 in GodClassAnalyzer.RunAsync at line 25. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2102— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs changed 89 times in last 90 days, max cyclomatic complexity 46 in ScanParsers.DependencyDetail at line 2102. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:431— engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs changed 59 times in last 90 days, max cyclomatic complexity 69 in SecretNoiseFilter.IsGenericRuleNoise at line 431. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2379— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs changed 45 times in last 90 days, max cyclomatic complexity 69 in DomainModelAnalyzer.AnemicDomainModel at line 2379. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:82— engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs changed 38 times in last 90 days, max cyclomatic complexity 78 in SolutionShapeAnalyzer.RunAsync at line 82. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/Kennel.Ui/wwwroot/kennel-ui.js src/Kennel.Ui/wwwroot/kennel-ui.js:212— src/Kennel.Ui/wwwroot/kennel-ui.js changed 52 times in last 90 days, max cyclomatic complexity 56 in (anonymous) at line 212. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- src/Kennel.Ui/wwwroot/kennel-ui.js`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:269— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs changed 56 times in last 90 days, max cyclomatic complexity 45 in EntryPointCatalog.DetectApplication at line 269. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4123— engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs changed 63 times in last 90 days, max cyclomatic complexity 40 in CloneSpanShape.Of at line 4123. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:622— engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs changed 78 times in last 90 days, max cyclomatic complexity 32 in FrontendEngineDimensions.DeadCodeDimension at line 622. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
TooManyMethods: AccessibilityAnalyzer engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs— TooManyMethods — 4081 significant lines (blank, comment-only and punctuation-only lines excluded), 319 methods, declared across 4 files: ModelAware/AccessibilityAnalyzer.cs (303), ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs (7), ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs (7), ModelAware/AccessibilityAnalyzer.HtmlStringBlindness.cs (2). The bar is 30 methods; this is 289 over it, 10.63× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: SupplyChainProvenanceAnalyzer engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs— TooManyMethods — 4716 significant lines (blank, comment-only and punctuation-only lines excluded), 236 methods, declared across 8 files: CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs (188), CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PublishTrigger.cs (13), CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingIdentity.cs (11), CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleasePathReach.cs (8), +4 more file(s). The bar is 30 methods; this is 206 over it, 7.87× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ProductionReadinessAnalyzer engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs— TooManyMethods — 2806 significant lines (blank, comment-only and punctuation-only lines excluded), 189 methods. The bar is 30 methods; this is 159 over it, 6.30× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: RoslynExplicitDebtCollector engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs— TooManyMethods — 2274 significant lines (blank, comment-only and punctuation-only lines excluded), 189 methods, declared across 2 files: ExplicitDebt/RoslynExplicitDebtCollector.cs (170), ExplicitDebt/RoslynExplicitDebtCollector.Vb.cs (19). The bar is 30 methods; this is 159 over it, 6.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LogicDefectAnalyzer engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs— TooManyMethods — 2008 significant lines (blank, comment-only and punctuation-only lines excluded), 167 methods. The bar is 30 methods; this is 137 over it, 5.57× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: IncompletenessAnalyzer engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs— TooManyMethods — 1685 significant lines (blank, comment-only and punctuation-only lines excluded), 146 methods. The bar is 30 methods; this is 116 over it, 4.87× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: GoDomainConventions engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs— TooManyMethods — 1057 significant lines (blank, comment-only and punctuation-only lines excluded), 143 methods. The bar is 30 methods; this is 113 over it, 4.77× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: DomainModelAnalyzer engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs— TooManyMethods — 2337 significant lines (blank, comment-only and punctuation-only lines excluded), 131 methods. The bar is 30 methods; this is 101 over it, 4.37× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: JsDuplicationDetector engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs— TooManyMethods — 2824 significant lines (blank, comment-only and punctuation-only lines excluded), 127 methods. The bar is 30 methods; this is 97 over it, 4.23× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ComplianceSecurityAnalyzer engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs— TooManyMethods — 2550 significant lines (blank, comment-only and punctuation-only lines excluded), 125 methods. The bar is 30 methods; this is 95 over it, 4.17× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ChangeCouplingAnalyzer engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs— TooManyMethods — 2039 significant lines (blank, comment-only and punctuation-only lines excluded), 121 methods. The bar is 30 methods; this is 91 over it, 4.03× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: SecretNoiseFilter engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs— TooManyMethods — 1447 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ReportViewModelFactory engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs— TooManyMethods — 1395 significant lines (blank, comment-only and punctuation-only lines excluded), 108 methods. The bar is 30 methods; this is 78 over it, 3.60× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: AnalyzeCommand engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs— TooManyMethods — 2176 significant lines (blank, comment-only and punctuation-only lines excluded), 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SourceClassifier engine/src/CodeHealth.Core/Classification/SourceClassifier.cs— TooManyMethods — 1210 significant lines (blank, comment-only and punctuation-only lines excluded), 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: ScanParsers engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs— TooManyMethods — 1205 significant lines (blank, comment-only and punctuation-only lines excluded), 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: MaturityAnalyzer engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs— TooManyMethods — 1441 significant lines (blank, comment-only and punctuation-only lines excluded), 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: RoslynTestQualityCollector engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs— TooManyMethods — 995 significant lines (blank, comment-only and punctuation-only lines excluded), 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DuplicationAnalyzer engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs— TooManyMethods — 1472 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DomainConventions engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs— TooManyMethods — 685 significant lines (blank, comment-only and punctuation-only lines excluded), 78 methods. The bar is 30 methods; this is 48 over it, 2.60× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: EntryPointCatalog engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs— TooManyMethods — 1031 significant lines (blank, comment-only and punctuation-only lines excluded), 72 methods. The bar is 30 methods; this is 42 over it, 2.40× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: FrontendDependencyHygiene engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs— TooManyMethods — 1012 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: RustDomainConventions engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs— TooManyMethods — 502 significant lines (blank, comment-only and punctuation-only lines excluded), 70 methods. The bar is 30 methods; this is 40 over it, 2.33× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: CSharpCorrectnessAnalyzer engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs— TooManyMethods — 1117 significant lines (blank, comment-only and punctuation-only lines excluded), 66 methods. The bar is 30 methods; this is 36 over it, 2.20× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: DeclaredDependencies engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs— TooManyMethods — 816 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: AnalyzeCommand.ExecuteCoreAsync engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:171— MethodTooLong — ExecuteCoreAsync runs 915 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 815 over it, 9.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DependencyHygieneAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:130— MethodTooLong — RunAsync runs 572 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 472 over it, 5.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CSharpCorrectnessAnalyzer.AnalyzeAsync engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:27— MethodTooLong — AnalyzeAsync runs 362 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 262 over it, 3.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SupplyChainProvenanceAnalyzer.WorkflowTokenHygiene engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8699— MethodTooLong — WorkflowTokenHygiene runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SupplyChainProvenanceAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2625— MethodTooLong — RunAsync runs 311 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 211 over it, 3.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.
MethodTooLong: ComplianceSecurityAnalyzer.S1 engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5493— MethodTooLong — S1 runs 293 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 193 over it, 2.93× 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: HotspotAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.GitMining/HotspotAnalyzer.cs:34— MethodTooLong — RunAsync runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× 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: KnowledgeConcentrationAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:152— MethodTooLong — RunAsync runs 274 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 174 over it, 2.74× 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: IncompletenessAnalyzer.AnalyzeAsync engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:146— MethodTooLong — AnalyzeAsync runs 250 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: SolutionShapeAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:82— MethodTooLong — RunAsync runs 242 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 142 over it, 2.42× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: JsDuplicationDetector.BuildDeclarationEntryMask engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:860— MethodTooLong — BuildDeclarationEntryMask runs 238 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 138 over it, 2.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.
MethodTooLong: SupplyChainProvenanceAnalyzer.BuildIntegrityArms engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2265— MethodTooLong — BuildIntegrityArms runs 218 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 118 over it, 2.18× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExplicitDebtAnalyzer.ToFinding engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:1039— MethodTooLong — ToFinding runs 217 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RoslynDuplicationDetector.ScanAsync engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:524— MethodTooLong — ScanAsync runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: CouplingAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:27— MethodTooLong — RunAsync runs 213 significant lines (blank, comment-only and punctuation-only lines excluded) 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.
MethodTooLong: ExplicitDebtAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:31— MethodTooLong — RunAsync runs 202 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 102 over it, 2.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.
MethodTooLong: KnowledgeFreshnessAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.GitMining/KnowledgeFreshnessAnalyzer.cs:81— MethodTooLong — RunAsync runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× 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: LogicDefectAnalyzer.AnalyzeAsync engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:89— MethodTooLong — AnalyzeAsync runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× 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: ReportViewModelFactory.Build engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:64— MethodTooLong — Build runs 188 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× 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: SolutionShapeAnalyzer.BuildFindings engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:823— MethodTooLong — BuildFindings runs 186 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× 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: StaticAnalysisAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.Security/StaticAnalysisAnalyzer.cs:85— MethodTooLong — RunAsync runs 182 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 82 over it, 1.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.
MethodTooLong: DuplicationAnalyzer.RunAsync engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:25— MethodTooLong — RunAsync runs 180 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 80 over it, 1.80× 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: NodeTestReliabilityCollector.CollectAsync engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:143— MethodTooLong — CollectAsync runs 178 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 78 over it, 1.78× 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: AccessibilityAnalyzer.Analyze engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:81— MethodTooLong — Analyze runs 171 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FrontendEngineDimensions.CloneRemediation engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:1477— MethodTooLong — CloneRemediation runs 168 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× 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.
FileTooLong: CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs— FileTooLong — 4035 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3535 over it, 8.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ModelAware/AccessibilityAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs— FileTooLong — 3770 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3270 over it, 7.54× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/main.rs engine/sidecars/rust-frontend/src/main.rs— FileTooLong — 2942 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 100 free functions. The bar is 500 significant lines; this is 2442 over it, 5.88× 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: Frontend/JsDuplicationDetector.cs engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs— FileTooLong — 2836 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2336 over it, 5.67× 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: Readiness/ProductionReadinessAnalyzer.cs engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs— FileTooLong — 2815 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2315 over it, 5.63× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Compliance/ComplianceSecurityAnalyzer.cs engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs— FileTooLong — 2654 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2154 over it, 5.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ModelAware/DomainModelAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs— FileTooLong — 2348 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1848 over it, 4.70× 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/AnalyzeCommand.cs engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs— FileTooLong — 2209 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1709 over it, 4.42× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ExplicitDebt/RoslynExplicitDebtCollector.cs engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs— FileTooLong — 2159 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1659 over it, 4.32× 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: CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs— FileTooLong — 2053 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1553 over it, 4.11× 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: ModelAware/LogicDefectAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs— FileTooLong — 2025 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1525 over it, 4.05× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: CodeShape/DuplicationAnalyzer.cs engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs— FileTooLong — 1862 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1362 over it, 3.72× 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: ModelAware/IncompletenessAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs— FileTooLong — 1695 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1195 over it, 3.39× 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: Maturity/MaturityAnalyzer.cs engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs— FileTooLong — 1470 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 970 over it, 2.94× 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: train/judge_assignment.py tools/train/judge_assignment.py— FileTooLong — 1466 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 966 over it, 2.93× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Scanners/SecretNoiseFilter.cs engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs— FileTooLong — 1453 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 953 over it, 2.91× 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: Templates/ReportViewModelFactory.cs engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs— FileTooLong — 1407 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 907 over it, 2.81× 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: CodeShape/RoslynDuplicationDetector.cs engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs— FileTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 772 over it, 2.54× 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: Scanners/ScanParsers.cs engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs— FileTooLong — 1225 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 725 over it, 2.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ModelAware/EventDrivenAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs— FileTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 668 over it, 2.34× 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: ModelAware/CSharpCorrectnessAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs— FileTooLong — 1126 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 626 over it, 2.25× 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: CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs— FileTooLong — 1070 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 570 over it, 2.14× 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: ModelAware/GoDomainConventions.cs engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs— FileTooLong — 1059 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 559 over it, 2.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: Frontend/EntryPointCatalog.cs engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs— FileTooLong — 1056 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 556 over it, 2.11× 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/ScoringSpecModel.cs engine/src/CodeHealth.Cli/Commands/ScoringSpecModel.cs— FileTooLong — 1037 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 537 over it, 2.07× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
Repeated repair: engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs:233— engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs changed 40 times in last 90 days and 24 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is DeepScan.ReadTrivyCheckBundle at line 233), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D29/01a09684-39ee): a dimension with no population to measure was published as low confidence”; “fix(D29/01a09654-2591): a check that never ran published 100% rule-coverage”; “fix(01a0961f-16ae): a missing tool in our own image was filed as a check the reader deliberately left off”; “fix(D31/01a07fde-acdd): admit Bicep and Ansible to the IaC gate, each with a checkov reader behind it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/CodeShape/DuplicationFinding.cs engine/src/CodeHealth.Core/CodeShape/DuplicationFinding.cs:281— engine/src/CodeHealth.Core/CodeShape/DuplicationFinding.cs changed 21 times in last 90 days and 14 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3 (its worst body is DuplicationFinding.PublishedIdentity.get at line 281), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(R10/01a0996c-5eca): the clone group's content is its identity, so its measured extent stops being”; “fix(R10/01a098cd-19c0): the listing arm claimed type bodies and prescribed a move they cannot take”; “fix(R10): a specialisation delegating to its base was told to extract the shared core it already has”; “fix(R10): a declaration run the WINDOW grain never saw was published unkeyed -- and the composition the plan expected does not exist”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/CodeShape/DuplicationFinding.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/sidecars/tsjs-frontend/main.mjs engine/sidecars/tsjs-frontend/main.mjs:20— engine/sidecars/tsjs-frontend/main.mjs changed 23 times in last 90 days and 12 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is main at line 20), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(01a08855-1404): the TS/JS sidecar emitted 'calls: []' as a LITERAL on every body record, so no TypeScript or JavaScript file could ever contribute a call site and D27 was structurally blind to both languages”; “fix(01a08fbe-3fe8): the TS/JS frontend stamped every type with the MODULE name, so every namespace-derived quantity was a constant on every TypeScript repository”; “fix(01a08855-1404): correct an overclaim in the park evidence — the namespace collapse is SHIELDED by this item, not live today”; “guard(01a08855-1404): D27's TS/JS blindness cannot be fixed by populating `calls` — the same sidecar collapses every type into ONE namespace, so the fix would publish a confident wrong number”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/sidecars/tsjs-frontend/main.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Orchestration/DimensionOrchestrator.cs engine/src/CodeHealth.Core/Orchestration/DimensionOrchestrator.cs:523— engine/src/CodeHealth.Core/Orchestration/DimensionOrchestrator.cs changed 18 times in last 90 days and 11 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is DimensionOrchestrator.UnclampedTimeoutFor at line 523), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D31,D32/01a09cb7-a534): derived tool budgets carved strictly inside the dimension, and a gdpr semgrep per-file limit that can fire”; “fix(D29/01a09c8d-e8ed): a derived SAST budget, and a semgrep per-file limit that can actually fire”; “fix(llm-ledger 01a08c8c-4c55): attribute every model call to the dimension that made it”; “fix(D4/orchestration): a dimension our clock cut off must never render as measured-clean”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Orchestration/DimensionOrchestrator.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Reporting/Templates/ReportViewModel.cs engine/src/CodeHealth.Reporting/Templates/ReportViewModel.cs:233— engine/src/CodeHealth.Reporting/Templates/ReportViewModel.cs changed 15 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is DimensionCard.WorstGradeKey.get at line 233), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(report a11y): the contrast fix was solved against the page, and the band words live on a card”; “fix(reporting/01a084c7-3bb6): a run that lost its own checkout told the customer their build was broken”; “fix(report): a dimension card may not display better than Adequate while it holds a Critical finding”; “fix(D32/Appendix C/C5): four report-integrity defects from one Umbraco report”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Reporting/Templates/ReportViewModel.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/Kennel.Admin.Core/Admin/Ui/Reviews.razor src/Kennel.Admin.Core/Admin/Ui/Reviews.razor— src/Kennel.Admin.Core/Admin/Ui/Reviews.razor changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2, UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(a11y, invites): widen the gate to the screens it never audited, then fix the 56 violating nodes it had been hiding”; “fix(a11y): controls with no name, pages with no title, tables with no headers”; “fix(g2): the trim button would have destroyed 400 questions, and every item now names its language”; “fix(g2): an audit is exactly the agreed number of questions, and the four at 120 can be cut back”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- src/Kennel.Admin.Core/Admin/Ui/Reviews.razor`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Toolchain/Roslyn/MsBuildRoslynWorkspace.cs engine/src/CodeHealth.Toolchain/Roslyn/MsBuildRoslynWorkspace.cs:215— engine/src/CodeHealth.Toolchain/Roslyn/MsBuildRoslynWorkspace.cs changed 10 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is MsBuildRoslynWorkspace.LoadCoreAsync at line 215), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(engine/01a08748-d7bf): a redundant NuGet package made a cleanly-loaded solution report BuildSucceeded=false”; “fix(reporting): customer-facing narratives followed the analyzer host's locale”; “fix(MODEL/D-450/01a058c1): FindSolution's maxDepth=3 left it strictly narrower than discovery's unbounded glob, so a repo whose solutions all sit at depth >= 4 resolved NO target and every Roslyn dimension abstained”; “fix(MODEL/D17/G-WEIXIN-ROSLYN-SOLUTION-PICKER): the solution search stopped at the shallowest depth holding ANY .sln, so a repo with one sln per sample scored the sample”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Toolchain/Roslyn/MsBuildRoslynWorkspace.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:279— engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is TestTierBudget.ForTiers at line 279), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D31,D32/01a09cb7-a534): derived tool budgets carved strictly inside the dimension, and a gdpr semgrep per-file limit that can fire”; “fix(D29/01a09c8d-e8ed): a derived SAST budget, and a semgrep per-file limit that can actually fire”; “fix(D4/orchestration): a dimension our clock cut off must never render as measured-clean”; “fix(scans): tell the engine its own run budget, so an inner bound can never outlive the outer one”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:950— engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs changed 9 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is SwiftDomainConventions.RawPrimitiveIds at line 950), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(DM4/DM6): "no domain types" and "a clean domain" are not the same 10.0 — the four arms that graded no population now have one”; “fix(ED3/swift): it reported correctly-named event cases as breaking the convention they follow”; “fix(DM2/swift): the last of four dimensions still asking CoreData for an id type it cannot have”; “fix(DM5/swift): the fields it told teams to make `let` cannot be `let`”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs:241— engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is TestProjectDetection.FindTestProjectsNotLoaded at line 241), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(engine/01a081bf-344e): LooksLikeTestProject reads the declared IsTestProject before guessing”; “fix(X2/01a081c4): the size census answered "is this a test?" without reading the declaration the analyzers read first”; “fix(X2/X3/D19/IC1): compose the IsTestProject read with the fixture-corpus guard — an explicit `false` must not admit a fixture corpus”; “fix(X2/X3/D19/IC1): the AUTHORITATIVE IsTestProject was unreadable, so the test vocabulary was name-and-path convention”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Scoring/MetaDimension.cs engine/src/CodeHealth.Core/Scoring/MetaDimension.cs:43— engine/src/CodeHealth.Core/Scoring/MetaDimension.cs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is MetaDimension.NotMeasuredReason.get at line 43), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(01a080ee-1ac9): the one publication question had two names, and only one of them was in the sidecar”; “fix(AX10): a card that cannot emit a finding now SAYS so, and the census reads it”; “fix(meta): a card that carries an "our gap" is not filed as irrelevant to the customer's codebase”; “fix(AC/D4): the a11y lens read 46 scaffold pages and called it the repository”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Scoring/MetaDimension.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Dimensions.Docs/AdrQualityAnalyzer.cs engine/src/CodeHealth.Dimensions.Docs/AdrQualityAnalyzer.cs:26— engine/src/CodeHealth.Dimensions.Docs/AdrQualityAnalyzer.cs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is AdrQualityAnalyzer.RunAsync at line 26), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D7,D10,D15,D23,D34/01a096bd-6276): sixteen dimensions published "does not apply here" as a low-confidence measurement”; “fix(D20/01a07fdf-dcd8): the repo-kind classifier read .NET project files only, so every non-.NET repository was Unknown and D20 abstained on all of them”; “fix(docs-d20/01a09287): the "No ADRs found" row stated the configured tier's bounds as the walk's, and said no ADR directory existed over one the owner could see”; “fix(D20): the repo-kind classifier reads .NET project files only and its no-evidence fallthrough was "Library", so every non-.NET repository was told it is a consumed library”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Docs/AdrQualityAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:25— engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs changed 8 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is AltTextQualityAnalyzer.AnalyzeAsync at line 25), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(01a0811a-868b): an abstain gate must ask WHY the population is empty”; “fix(01a089a0-97fd): a transient LLM abstention minted a permanent 'cannot be measured' backlog item off one repository, because OurGap merges two senses with opposite remedies”; “fix(01a08137-f2ac): an LLM abstention was typed by WHOSE it was, so an operator opt-out and a dead host both reported as a permanent gap in our analyzer”; “fix(modelaware): a11y advisory rows named the file by basename, so two products' rows read alike”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs:128— engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is DimensionResult.SynthesizedOurGap at line 128), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(engine): an our-gap result files itself with no reason, so 3,164 rows named nothing”; “fix(D29/01a09684-39ee): a dimension with no population to measure was published as low confidence”; “fix(01a077fc-22eb): a dimension that never ran said so three ways and the coverage channel heard none of them”; “fix(01a080ee-1ac9): the one publication question had two names, and only one of them was in the sidecar”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Dimensions.CodeQuality/IlEfficiencyAnalyzer.cs engine/src/CodeHealth.Dimensions.CodeQuality/IlEfficiencyAnalyzer.cs:35— engine/src/CodeHealth.Dimensions.CodeQuality/IlEfficiencyAnalyzer.cs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is IlEfficiencyAnalyzer.RunAsync at line 35), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D39): an environment build failure filed itself as a capability we never built”; “fix(D7,D10,D15,D23,D34/01a096bd-6276): sixteen dimensions published "does not apply here" as a low-confidence measurement”; “fix(D8/D11/D39): the concurrency gate keyed on the LIMIT, so two dotnet builds ran at once”; “fix(engine): a killed tool is a NAMED gap, and every tool budget is derived from the one that contains it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.CodeQuality/IlEfficiencyAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/Kennel.Admin.Core/Admin/Ui/CycleLifecycle.razor src/Kennel.Admin.Core/Admin/Ui/CycleLifecycle.razor— src/Kennel.Admin.Core/Admin/Ui/CycleLifecycle.razor changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 3, UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(console): the cycles banner repeated the provenance the cards hide; gate hints beside their buttons; one (i) per heading”; “fix(console): "Is the number any good?" showed ONE language's ABN as the cycle's”; “fix(console): a rule lifted out of its @media block became always-on”; “fix(console): 33 classes across the new pages had no rule anywhere”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- src/Kennel.Admin.Core/Admin/Ui/CycleLifecycle.razor`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Statistics/BuildStatistics.cs engine/src/CodeHealth.Core/Statistics/BuildStatistics.cs:268— engine/src/CodeHealth.Core/Statistics/BuildStatistics.cs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is BuildStatistics.BlockedByEnvironment.get at line 268), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D18/01a084e5-12d3): a build input WE lost counted as the customer's compile failure”; “fix(D18): stop capping a repo for compile errors an unloadable project manufactured”; “fix(D18): a build we could not run told the owner their build failed”; “fix(D18): a VB.NET or F# repo that does not compile was told the failure was ours”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Statistics/BuildStatistics.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Toolchain/Isolation/IsolatedWorkspace.cs engine/src/CodeHealth.Toolchain/Isolation/IsolatedWorkspace.cs:226— engine/src/CodeHealth.Toolchain/Isolation/IsolatedWorkspace.cs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is IsolatedWorkspace.DeclaredSubmodulePaths at line 226), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(platform/01a09e22-7957): refuse an EMPTY isolated checkout at the isolation boundary (engine exit 9) instead of analysing nothing and signing it”; “fix(scan-pipeline/01a080d1): the engine's isolated checkout was hard-wired to the shared temp filesystem, so one scan could take the whole box down and nothing measured the filesystem it filled”; “fix(engine 01a08ed4-978b): the directories ABOVE the scan root are not the repository”; “fix(engine): isolate by reading the checkout, not by writing into it”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Toolchain/Isolation/IsolatedWorkspace.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: tools/localdev/ui/a11y-gate.mjs tools/localdev/ui/a11y-gate.mjs:146— tools/localdev/ui/a11y-gate.mjs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is main at line 146), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(a11y-gate): it was auditing the dark theme twice and reporting two”; “fix(a11y, invites): widen the gate to the screens it never audited, then fix the 56 violating nodes it had been hiding”; “R2: break up the three main() functions the R4 fix created”; “watchdog audit: 39 findings fixed across 8 dimensions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- tools/localdev/ui/a11y-gate.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingLanguages.razor src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingLanguages.razor— src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingLanguages.razor changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5, UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(console): the Languages page rendered a literal "}" - and nothing objected”; “fix(console): 33 classes across the new pages had no rule anywhere”; “fix(console): the split is green - and the last red tests found four more losses”; “fix(console): restore what the split dropped - alerts, holdout, and three regressions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingLanguages.razor`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Dimensions.Security/DataComplianceAnalyzer.cs engine/src/CodeHealth.Dimensions.Security/DataComplianceAnalyzer.cs:85— engine/src/CodeHealth.Dimensions.Security/DataComplianceAnalyzer.cs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is DataComplianceAnalyzer.ResultFor at line 85), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D31,D32/01a09cb7-a534): derived tool budgets carved strictly inside the dimension, and a gdpr semgrep per-file limit that can fire”; “fix(d32): a file semgrep could not parse no longer ships inside a clean PII sweep”; “fix(D32/Appendix C/C5): four report-integrity defects from one Umbraco report”; “fix(engine): restore D32 (PII/GDPR), and stop a missing capability reading as an absent subject”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Security/DataComplianceAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs:26— engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is CommentValueAnalyzer.RunAsync at line 26), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D7,D10,D15,D23,D34/01a096bd-6276): sixteen dimensions published "does not apply here" as a low-confidence measurement”; “fix(D24/01a0772b-7ead): a comment verdict shipped without anything checking it against its own site”; “fix(llm): the "outage" was two dimensions not saying they call a model”; “fix(D24): a one-word comment swallowed by a longer quote stole the row's location”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Adr/FileSystemAdrInventoryBuilder.cs engine/src/CodeHealth.Core/Adr/FileSystemAdrInventoryBuilder.cs:17— engine/src/CodeHealth.Core/Adr/FileSystemAdrInventoryBuilder.cs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is FileSystemAdrInventoryBuilder.BuildAsync at line 17), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(D20/01a0798f-0d4f): a bold-emphasised word was read as a declared enforcement field”; “fix(D7/01a07d11-606b): a declared enforcement value we could not map read as no field at all”; “fix(docs-d20/01a09287): the "No ADRs found" row stated the configured tier's bounds as the walk's, and said no ADR directory existed over one the owner could see”; “fix(engine 01a08db6-0ced): the D25 ADR conformance prompt is content-addressed again, not keyed on the scratch checkout”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Adr/FileSystemAdrInventoryBuilder.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/sidecars/tsjs-frontend/extract-file.mjs engine/sidecars/tsjs-frontend/extract-file.mjs:130— engine/sidecars/tsjs-frontend/extract-file.mjs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is typeRefOfNode at line 130), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(01a09005-4d4b): every TS/JS constructor reached the neutral model as MethodKind.Ordinary, because the frontend emitted a CAPITALISED methodKind that the provider's parser matched case-sensitively and dropped to its default”; “fix(01a08fe6-2352): the TS/JS sidecar emitted NO member type at all, so D27's collaborator sample was empty on every TypeScript repository and locality was the "measured nothing" literal”; “fix(01a08fbe-3fe8): the TS/JS frontend stamped every type with the MODULE name, so every namespace-derived quantity was a constant on every TypeScript repository”; “watchdog audit: 39 findings fixed across 8 dimensions”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/sidecars/tsjs-frontend/extract-file.mjs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: engine/src/CodeHealth.Core/Scoring/LanguageCensus.cs engine/src/CodeHealth.Core/Scoring/LanguageCensus.cs:60— engine/src/CodeHealth.Core/Scoring/LanguageCensus.cs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is LanguageCensus.TakeAsync at line 60), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(engine/01a0a3e3-b1e1): `.ts` is also the HLS video segment, so 21 committed MPEG-2 streams counted as 411,343 lines of production TypeScript and degraded a Swift repository”; “fix(platform/01a0a098-6082): the honesty denominators and the language census now count the languages the engine cannot read”; “fix(census): a bundle somebody else's compiler emitted is not this repo's authored source”; “fix(D34/01a05750): a gem's declared entry point had no extension, so five separate gates each hid it and its 130 lines were counted nowhere”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-17..2026-09-15, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-17 14:31:48 +02:00' --until='2026-09-15 14:31:48 +02:00' --full-history --no-merges -- engine/src/CodeHealth.Core/Scoring/LanguageCensus.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:122— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:122-132 | engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:184-203 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:327— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:327-337 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:1412-1422 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:1412` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:475— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:475-485 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2035-2045 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:475` 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:873— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:873-883 | engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1343-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1963— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1963-1973 | engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1982-1992 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1963` 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:744— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:744-754 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:780-790 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:744` 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:321— engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:321-331 | engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:385-395 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:321` 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:345— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:345-355 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:529-540 — 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 `engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:345` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:526` calls `Equals` and `engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:342` 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) engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:101— engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:101-112 | engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:201-211 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:101` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6272— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6272-6282 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6312-6322 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6272` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedKeyStoreScan.cs:77— engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedKeyStoreScan.cs:77-87 | engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedPrivateKeyBlobScan.cs:51-61 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedKeyStoreScan.cs:77` 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. 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 (11 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:113— engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:113-123 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1331-1341 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:113` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:559— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:559-569 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:792-802 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:559` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6407— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6407-6417 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6491-6501 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6407` 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynProvider.cs:315— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynProvider.cs:315-325 | engine/src/CodeHealth.Core/ModelAware/SymbolHelpers.cs:186-196 — 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. 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 (11 lines × 2) engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:561— engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:561-571 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:271-281 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/Markup/AstroMarkupProducer.cs:111— engine/src/CodeHealth.Core/Markup/AstroMarkupProducer.cs:111-121 | engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:103-113 — 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:166— engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:166-176 | engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:225-235 — 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 (11 lines × 2) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:408— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:408-418 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:744-754 — 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 (11 lines × 2) engine/src/CodeHealth.Core/Testing/FSharpTestProjectScanner.cs:144— engine/src/CodeHealth.Core/Testing/FSharpTestProjectScanner.cs:144-154 | engine/src/CodeHealth.Reporting/Linting/FindingTextRules.cs:171-181 — 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. 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 (11 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:102— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:102-112 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeMutableServiceImageScan.cs:83-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (11 lines × 2) engine/src/CodeHealth.Dimensions.Docs/Llm/AdrQualityEvaluation.cs:33— engine/src/CodeHealth.Dimensions.Docs/Llm/AdrQualityEvaluation.cs:33-43 | engine/src/CodeHealth.Dimensions.Docs/Llm/DocumentationEvaluation.cs:23-33 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1722— engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1722-1732 | engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:2067-2077 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:328— engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:328-336 | engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:313-321 — 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 `engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `codeModel` to `CodeModel.ICodeModel` in one and `ICodeModel` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) engine/src/CodeHealth.Core/Dependencies/PnpmLockfileReader.cs:241— engine/src/CodeHealth.Core/Dependencies/PnpmLockfileReader.cs:241-249 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10641-10649 — 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. 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 (9 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2502— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2502-2510 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2537-2545 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2502` 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 (9 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:911— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:911-919 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:981-989 — both copies are in the same file, so extract the 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, `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:938` calls `IsUiThreadAffineViewType` and `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:990` 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 (9 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:380— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:380-388 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1039-1047 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (9 lines × 2) engine/src/CodeHealth.Core/Scoring/SourceTreeWalk.cs:162— engine/src/CodeHealth.Core/Scoring/SourceTreeWalk.cs:162-170 | engine/src/CodeHealth.Core/Scoring/SourceTreeWalk.cs:276-284 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Scoring/SourceTreeWalk.cs:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 2) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1364— engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1364-1372 | engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1382-1390 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:243— engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:243-251 | engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:688-696 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:243` 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 (9 lines × 2) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3952— engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3952-3960 | engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3961-3969 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Dimensions.Security/RuntimeEnforcementAnalyzer.cs:61— engine/src/CodeHealth.Dimensions.Security/RuntimeEnforcementAnalyzer.cs:61-69 | engine/src/CodeHealth.Dimensions.Security/SyscallConfinementAnalyzer.cs:49-57 — 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 `engine/src/CodeHealth.Dimensions.Security/RuntimeEnforcementAnalyzer.cs:61` 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 (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:345— engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:345-353 | engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:213-221 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:210` calls `IsPlaceholder`, `IsMatch` and `engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:342` 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 (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:454— engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:454-462 | engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:474-482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3358— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3358-3366 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3484-3492 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3358` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7297— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7297-7305 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8601-8609 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7297` 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. 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. 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, `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7296` calls `LeadingSpaces` and `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8600` 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 (9 lines × 2) engine/src/CodeHealth.Core/Architecture/ArchitectureMapBuilder.cs:364— engine/src/CodeHealth.Core/Architecture/ArchitectureMapBuilder.cs:364-372 | engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:247-255 — 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 (9 lines × 2) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:423— engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:423-431 | engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:502-510 — 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 (9 lines × 2) engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:181— engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:181-189 | engine/src/CodeHealth.Core/Dependencies/UnityPackageHygiene.cs:220-228 — 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 (9 lines × 2) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1943— engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1943-1951 | engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1249-1257 — 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. 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 (9 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1670— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1670-1678 | engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1279-1287 — 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 (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:274— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:274-282 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:177-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/InsecureTransportFetchScan.cs:322— engine/src/CodeHealth.Dimensions.Security/Scanners/InsecureTransportFetchScan.cs:322-330 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1135-1143 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) src/Kennel.Core/Billing/Ui/PlanCancel.razor:71— src/Kennel.Core/Billing/Ui/PlanCancel.razor:71-79 | src/Kennel.Core/Billing/Ui/PlanRefer.razor:93-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:134— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:134-143 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:117-125 — 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 `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:134` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/BicepExtractor.cs:144— engine/src/CodeHealth.Core/Architecture/Topology/Extractors/BicepExtractor.cs:144-158 | engine/src/CodeHealth.Core/Architecture/Topology/Extractors/TerraformExtractor.cs:159-173 — 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 `engine/src/CodeHealth.Core/Architecture/Topology/Extractors/BicepExtractor.cs:144` 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. 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 (15 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:120— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:120-134 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:124-138 — 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 `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:120` 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) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:225— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:225-239 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:194-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:218` calls `RoslynTypeRef` and `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs: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.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2236— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2236-2250 | engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2603-2617 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2600` calls `Exists` and `engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2234` 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 (15 lines × 2) engine/src/CodeHealth.Core/Discovery/FrontendSourcePresence.cs:60— engine/src/CodeHealth.Core/Discovery/FrontendSourcePresence.cs:60-74 | engine/src/CodeHealth.Core/Discovery/FrontendSourcePresence.cs:126-140 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Discovery/FrontendSourcePresence.cs:60` 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) engine/src/CodeHealth.Core/Discovery/UnreadManifestDisclosure.cs:320— engine/src/CodeHealth.Core/Discovery/UnreadManifestDisclosure.cs:320-334 | engine/src/CodeHealth.Core/Discovery/UnreadManifestDisclosure.cs:370-384 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Discovery/UnreadManifestDisclosure.cs:320` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1856— engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1856-1891 | engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1905-1919 — both copies are in the same file, so extract the 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.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:267— engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:267-281 | engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:441-455 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:267` 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. 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 (15 lines × 2) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1641— engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1641-1655 | engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:299-313 — 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 `engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1641` 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) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:642— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:642-656 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2203-2217 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:642` 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. 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 (15 lines × 2) engine/src/CodeHealth.Core/ModelAware/ElixirDomainConventions.cs:174— engine/src/CodeHealth.Core/ModelAware/ElixirDomainConventions.cs:174-188 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:371-385 — 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 `engine/src/CodeHealth.Core/ModelAware/ElixirDomainConventions.cs:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:262— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:262-276 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:511-525 — 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 `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:262` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:519— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:519-533 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:332-346 — 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 `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:519` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/ModelAware/WcagCoverage.cs:51— engine/src/CodeHealth.Core/ModelAware/WcagCoverage.cs:51-65 | engine/src/CodeHealth.Core/ModelAware/WcagCoverage.cs:90-104 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/WcagCoverage.cs:51` 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. 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. 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 (15 lines × 2) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5202— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5202-5216 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5266-5280 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5202` 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) engine/src/CodeHealth.Dimensions.Security/Scanners/EndOfLifeBaseImageScan.cs:184— engine/src/CodeHealth.Dimensions.Security/Scanners/EndOfLifeBaseImageScan.cs:184-198 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableBaseImageScan.cs:109-124 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/EndOfLifeBaseImageScan.cs:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Security/Scanners/MutableBaseImageScan.cs:109` calls `IsVendorReadableDockerfileName` and `engine/src/CodeHealth.Dimensions.Security/Scanners/EndOfLifeBaseImageScan.cs:184` does not — after which the two agree again for 5 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 (15 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:430— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:430-444 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:533-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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:430` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (15 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:162— engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:162-176 | engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:271-285 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:162` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5132— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5132-5146 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5205-5219 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5132` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `root` to `bool checksums) ScanGoReleaserManifest(string` in one and `string` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7820— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7820-7834 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7943-7957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:307— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:307-321 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:284-298 — before extracting anything, compare `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs` and `engine/src/CodeHealth.Core/Testing/RustTestCensus.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 183 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 `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:307` 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. 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 (14 lines × 2) engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:272— engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:272-285 | engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs:350-363 — 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. 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 (14 lines × 2) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2187— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2187-2200 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2536-2549 — both copies are in the same file, so extract the 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.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:42— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:42-55 | engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:88-101 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:290— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:290-303 | engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:532-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs: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.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:664— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:664-677 | engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:703-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:664` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:718` calls `Split` and `engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:680` 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 (14 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:328— engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:328-341 | engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:406-421 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:220— engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:220-233 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs:302-315 — 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. 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 (14 lines × 2) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3272— engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3272-3285 | engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3386-3399 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3272` 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 (14 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4993— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4993-5006 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5121-5134 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4993` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9097— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9097-9110 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9307-9320 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9097` 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. 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 (14 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:614— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:614-627 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:663-676 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:614` 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 (14 lines × 2) engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:302— engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:302-316 | engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:329-342 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:302` 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. 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 (14 lines × 2) engine/src/CodeHealth.Core/Scoring/CaiScoring.cs:112— engine/src/CodeHealth.Core/Scoring/CaiScoring.cs:112-125 | engine/src/CodeHealth.Reporting/Scorecard/ScorecardJsonRenderer.cs:30-43 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Reporting/Changelog/ChangelogDraftRenderer.cs:82— engine/src/CodeHealth.Reporting/Changelog/ChangelogDraftRenderer.cs:82-95 | engine/src/CodeHealth.Reporting/Changelog/ChangelogDraftRenderer.cs:137-150 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Reporting/Changelog/ChangelogDraftRenderer.cs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:212— engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:212-225 | engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:167-180 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:212` 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `lines` to `int End)? PodSpec(IReadOnlyList<string>` in one and `string Path)? HostPathBacking(IReadOnlyList<string>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:88— engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:88-101 | engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:105-118 — 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 (14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:136— engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:136-149 | engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:143-156 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:136` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1158— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1158-1171 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1219-1232 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1158` 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 (14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:106— engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:106-119 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:282-295 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:106` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `command` to `IReadOnlyList<string> Paths)? SetuidPaths(string` in one and `IReadOnlyList<string> Paths)? WorldWritablePaths(string` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 2) src/Kennel.Assay.Core/Governance/Ui/RepoVerdict.razor:150— src/Kennel.Assay.Core/Governance/Ui/RepoVerdict.razor:150-163 | src/Kennel.Core/Repositories/Ui/RepoHub.razor:706-719 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/ArmExtractor.cs:138— engine/src/CodeHealth.Core/Architecture/Topology/Extractors/ArmExtractor.cs:138-151 | engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CloudFormationExtractor.cs:151-164 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Architecture/Topology/Extractors/ArmExtractor.cs:135` calls `Has`, `Any`, `Contains` and `engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CloudFormationExtractor.cs:148` 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 (13 lines × 2) engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:92— engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:92-104 | engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:159-172 — 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 `engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:92` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:90` calls `ThrowIfNull` and `engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:159` 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 (13 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:537— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:537-549 | engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:244-256 — 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 (13 lines × 2) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:553— engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:553-565 | engine/src/CodeHealth.Core/FileQuality/GeneratedRegionScan.cs:235-247 — 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 `engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:553` 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. 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. 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 (13 lines × 2) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1319— engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1319-1331 | engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1363-1375 — both copies are in the same file, so extract the 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.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:72— engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:72-86 | engine/src/CodeHealth.Core/CodeShape/NeutralTypeLengthScanner.cs:67-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 `engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:72` 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. 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 (13 lines × 2) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582-2594 | engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:191-203 — 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 `engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582` 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. 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. 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 (13 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:479— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:479-491 | engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:710-722 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:479` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1509— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1509-1521 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:302-314 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1509` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:860— engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:860-889 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:80-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (13 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:41— engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:41-53 | engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:398-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:227— engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:227-239 | engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:303-315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:227` 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. 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 (13 lines × 2) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:681— engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:681-693 | engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:1045-1057 — 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 `engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:681` 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. 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 (13 lines × 2) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1017— engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1017-1029 | engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1034-1046 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1017` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1046— engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1046-1058 | engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1070-1082 — both copies are in the same file, so extract the 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.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5471— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5471-5483 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5557-5569 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5471` 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 (13 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:361— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:361-373 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1731-1743 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:361` 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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `type` to `INamedTypeSymbol` in one and `Nm.ICodeType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1115— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1115-1128 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3423-3435 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1115` 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 (13 lines × 2) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:523— engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:523-535 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:582-594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) engine/src/CodeHealth.Dimensions.Architecture/NavigabilityAnalyzer.cs:164— engine/src/CodeHealth.Dimensions.Architecture/NavigabilityAnalyzer.cs:164-176 | engine/src/CodeHealth.Dimensions.Architecture/NavigabilityAnalyzer.cs:187-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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. 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 (13 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7279— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7279-7291 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8585-8597 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:698— engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:698-710 | engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:724-736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:698` 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 (12 lines × 2) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CdkExtractor.cs:64— engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CdkExtractor.cs:64-75 | engine/src/CodeHealth.Core/Architecture/Topology/Extractors/PulumiExtractor.cs:38-49 — 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 `engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CdkExtractor.cs:64` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:242— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:242-253 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:211-222 — 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 (12 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:453— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:453-464 | engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:682-693 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:453` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:449` calls `Push`, `SliceFrame` and `engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:678` 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 (12 lines × 2) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:231— engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:231-242 | engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:360-371 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:231` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4402— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4402-4413 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5606-5617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:999— engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:999-1010 | engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1070-1082 — both copies are in the same file, so extract the 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.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7889— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7889-7900 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:8231-8242 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7889` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:685— engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:685-696 | engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:832-843 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:685` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1679— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1679-1690 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5099-5120 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1679` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:644— engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:644-655 | engine/src/CodeHealth.Core/ModelAware/JsInteropContractAnalyzer.cs:50-61 — 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 `engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:644` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:384— engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:384-397 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:455-466 — 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 (12 lines × 2) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:111— engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:111-122 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:130-141 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:111` 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. 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 (12 lines × 2) engine/src/CodeHealth.Core/Scoring/CompileRemovedPaths.cs:200— engine/src/CodeHealth.Core/Scoring/CompileRemovedPaths.cs:200-211 | engine/src/CodeHealth.Core/Testing/CompileExcludedTestFiles.cs:178-189 — 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 `engine/src/CodeHealth.Core/Scoring/CompileRemovedPaths.cs:200` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Scoring/CompileRemovedPaths.cs:199` calls `Replace`, `Trim` and `engine/src/CodeHealth.Core/Testing/CompileExcludedTestFiles.cs:177` 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 (12 lines × 2) engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:333— engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:333-344 | engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:444-455 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:333` 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 (12 lines × 2) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:1426— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:1426-1437 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:1458-1469 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:1426` 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 (12 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:429— engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:429-440 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:348-359 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:429` 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. 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. 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 (12 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:146— engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:146-157 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:321-332 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:937— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:937-951 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:963-974 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:937` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:266— engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:266-277 | engine/src/CodeHealth.Core/ExplicitDebt/RazorGeneratedDocumentSynthesizer.cs:619-630 — 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 (12 lines × 2) engine/src/CodeHealth.Core/Testing/CoverletCoverageCollector.cs:318— engine/src/CodeHealth.Core/Testing/CoverletCoverageCollector.cs:318-329 | engine/src/CodeHealth.Core/Testing/PolyglotCoverageCollector.cs:62-73 — 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.
codehealth_rust_sidecar::substitute_template (cognitive 77) engine/sidecars/rust-frontend/src/main.rs:2951— codehealth_rust_sidecar::substitute_template has cognitive complexity 77 (threshold 15). Drivers by points: if/else 10 (44 pts), loops 4 (18 pts), match/switch 4 (14 pts), boolean chains 1 (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::select_arms (cognitive 41) engine/sidecars/rust-frontend/src/main.rs:4385— codehealth_rust_sidecar::select_arms has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 5 (14 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::var_prefixes (cognitive 40) engine/sidecars/rust-frontend/src/main.rs:2765— codehealth_rust_sidecar::var_prefixes has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (32 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 21). 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.
codehealth_rust_sidecar::rep_prefixes (cognitive 29) engine/sidecars/rust-frontend/src/main.rs:2845— codehealth_rust_sidecar::rep_prefixes has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (9 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::cfg_test_declared_module_files (cognitive 25) engine/sidecars/rust-frontend/src/main.rs:541— codehealth_rust_sidecar::cfg_test_declared_module_files has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 3 (8 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::collect_crate_reexported_defs_in (cognitive 24) engine/sidecars/rust-frontend/src/main.rs:2247— codehealth_rust_sidecar::collect_crate_reexported_defs_in has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::crate_and_module (cognitive 23) engine/sidecars/rust-frontend/src/main.rs:634— codehealth_rust_sidecar::crate_and_module has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (4 pts), boolean chains 2, 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.
codehealth_rust_sidecar::dup_substitute (cognitive 22) engine/sidecars/rust-frontend/src/main.rs:370— codehealth_rust_sidecar::dup_substitute has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (6 pts), loops 2 (4 pts) (nesting depth added 14). 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.
codehealth_rust_sidecar::parse_matcher (cognitive 22) engine/sidecars/rust-frontend/src/main.rs:2569— codehealth_rust_sidecar::parse_matcher has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (13 pts), if/else 2 (8 pts), loops 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
codehealth_rust_sidecar::main (cognitive 21) engine/sidecars/rust-frontend/src/main.rs:23— codehealth_rust_sidecar::main has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (9 pts), match/switch 5 (8 pts), if/else 3 (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.
codehealth_rust_sidecar::collect_impl (cognitive 21) engine/sidecars/rust-frontend/src/main.rs:1763— codehealth_rust_sidecar::collect_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts), boolean chains 2, 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.
codehealth_rust_sidecar::inner_named (cognitive 21) engine/sidecars/rust-frontend/src/main.rs:5033— codehealth_rust_sidecar::inner_named has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 1 (4 pts), match/switch 1 (nesting depth added 15). 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.
codehealth_rust_sidecar::split_attrs (cognitive 20) engine/sidecars/rust-frontend/src/main.rs:5101— codehealth_rust_sidecar::split_attrs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::collect_exported_defs_in (cognitive 19) engine/sidecars/rust-frontend/src/main.rs:2132— codehealth_rust_sidecar::collect_exported_defs_in has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::cfg_selects_test (cognitive 19) engine/sidecars/rust-frontend/src/main.rs:5219— codehealth_rust_sidecar::cfg_selects_test has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts), boolean chains 1, 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.
codehealth_rust_sidecar::collect_macro_rules_defs (cognitive 18) engine/sidecars/rust-frontend/src/main.rs:2348— codehealth_rust_sidecar::collect_macro_rules_defs has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
codehealth_rust_sidecar::dup_parse_header (cognitive 17) engine/sidecars/rust-frontend/src/main.rs:315— codehealth_rust_sidecar::dup_parse_header has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 2 (7 pts), if/else 2 (5 pts), loops 2 (5 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.
codehealth_rust_sidecar::collect_macro_declared_types (cognitive 17) engine/sidecars/rust-frontend/src/main.rs:1939— codehealth_rust_sidecar::collect_macro_declared_types has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 4 (7 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
codehealth_rust_sidecar::match_prefixes (cognitive 16) engine/sidecars/rust-frontend/src/main.rs:2714— codehealth_rust_sidecar::match_prefixes has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 2 (4 pts), loops 2 (3 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×18
Members sharing a duplicated core (4 members, 50+ identical tokens) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:81— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:81-214 | engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:98-225 | engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:106-414 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:76-196 — 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) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:385— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:385-410 | engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:341-366 | engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:530-555 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:206-231 — 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) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2080— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2080-2136 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2182-2276 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2419-2495 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2534-2595 — 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) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:120— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:120-156 | engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:182-228 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:117-151 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:185-231 — 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) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:849— engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:849-1130 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:73-144 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:170-200 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:210-232 — 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) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3531— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3531-3563 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3592-3624 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3650-3670 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3766-3798 — 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) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5354— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5354-5397 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5426-5483 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5508-5569 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5887-5921 — 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) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:391— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:391-396 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:520-525 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:530-535 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:702-707 — 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) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:566— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:566-586 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:538-558 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:549-569 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:720-741 — 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) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:41— engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:41-82 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:81-128 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs:136-203 | engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:356-444 — 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) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6268— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6268-6295 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6308-6346 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6781-6815 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7754-7801 — 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) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1411— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1411-1430 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1476-1495 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1641-1660 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1749-1768 — 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) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1666— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1666-1695 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1715-1744 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1774-1804 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1810-1839 — 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) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:112— engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:112-152 | engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:82-127 | engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:58-100 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:91-149 — 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) engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:55— engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:55-105 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:55-113 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRedundantReDefaultRecheck.cs:54-77 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs:50-93 — 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) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:613— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:613-653 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:690-728 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:749-788 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1783-1813 — 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) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3839— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3839-3877 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3886-3924 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4245-4316 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4400-4441 — 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) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:362— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:362-392 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:231-261 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:260-290 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:339-369 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (10 lines × 2) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CrossplaneExtractor.cs:32— engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CrossplaneExtractor.cs:32-41 | engine/src/CodeHealth.Core/Architecture/Topology/Extractors/KubernetesExtractor.cs: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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CrossplaneExtractor.cs:32` 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) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:321— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:321-330 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:244-253 — 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 `engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:321` 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) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:903— engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:903-912 | engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:59-68 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:903` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:318— engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:318-327 | engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:406-416 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:318` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:778— engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:778-787 | engine/src/CodeHealth.Core/Statistics/XmlProjectGraphBuilder.cs:91-100 — 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 `engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:778` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:908— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:908-919 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2629-2638 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:908` 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. 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 (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4902— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4902-4911 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:160-169 — 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 (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:385— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:385-394 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:689-698 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:385` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:685` calls `HandlerDependsOnOutbox` and `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:384` 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 (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:236— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:236-245 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:418-427 — 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 `engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:236` 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. 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 (10 lines × 2) engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:151— engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:151-165 | engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs:45-54 — 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 `engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:151` 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) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:148— engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:148-157 | engine/src/CodeHealth.Dimensions.Security/OsvScannerAnalyzer.cs:214-236 — 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.
Duplicated block (10 lines × 2) src/Kennel.Core/Billing/Ui/CohortTermsPage.razor:155— src/Kennel.Core/Billing/Ui/CohortTermsPage.razor:155-164 | src/Kennel.Core/Questionnaires/Ui/ReviewRunner.razor:740-749 — 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. 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 (10 lines × 2) src/Kennel.Assay.Core/Governance/Ui/BarDetail.razor:234— src/Kennel.Assay.Core/Governance/Ui/BarDetail.razor:234-243 | src/Kennel.Assay.Core/Governance/Ui/GovernanceBars.razor:199-208 — 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) engine/src/CodeHealth.Core/ModelAware/FSharpDomainConventions.cs:101— engine/src/CodeHealth.Core/ModelAware/FSharpDomainConventions.cs:101-110 | engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:65-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 (10 lines × 2) engine/src/CodeHealth.Core/ModelAware/ScatteredDecision.cs:106— engine/src/CodeHealth.Core/ModelAware/ScatteredDecision.cs:106-115 | engine/src/CodeHealth.Core/ModelAware/ScatteredDerivation.cs:220-229 — 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 (10 lines × 2) engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:365— engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:365-374 | engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:255-264 — 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 (10 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:335— engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:335-344 | engine/src/CodeHealth.Dimensions.Security/Scanners/NamespaceScopedRuleAggregator.cs:368-377 — 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 (10 lines × 2) src/Kennel.Admin.Core/Admin/Ui/CorpusGrowth.razor:106— src/Kennel.Admin.Core/Admin/Ui/CorpusGrowth.razor:106-115 | src/Kennel.Admin.Core/Admin/Ui/Decisions.razor:173-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:449— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:449-454 | engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:598-605 — 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 `engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:449` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:667— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:667-672 | engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:719-724 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:667` 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 (6 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:205— engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:205-210 | engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:248-253 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:393— engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:393-398 | engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:45-50 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:393` 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1394— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1394-1401 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1405-1410 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1681— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1681-1688 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1716-1721 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1681` 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. 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1506— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1506-1511 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4737-4742 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1506` 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. 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:813— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:813-818 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1958-1963 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:813` 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. 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:919— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:919-924 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1402-1407 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:919` 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. 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1006— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1006-1015 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1672-1677 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1006` 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. 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 (6 lines × 2) engine/src/CodeHealth.Toolchain/Git/GitHistory.cs:112— engine/src/CodeHealth.Toolchain/Git/GitHistory.cs:112-117 | engine/src/CodeHealth.Toolchain/Git/LibGit2GitAccessor.cs:73-78 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:332— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:332-337 | engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:543-548 — 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) engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:69— engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:69-74 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:74-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. 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 (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1488— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1488-1493 | engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1851-1856 — 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) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1527— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1527-1532 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:834-839 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:289— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:289-294 | engine/src/CodeHealth.Core/ModelAware/KotlinDomainConventions.cs:82-87 — 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 (6 lines × 2) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityAnalyzer.cs:338— engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityAnalyzer.cs:338-343 | engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs:1656-1661 — 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) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:736— engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:736-741 | engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:791-796 — 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 `engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:736` 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.
ClassTooLong: DependencyHygieneAnalyzer engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs— ClassTooLong — 1060 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 660 over it, 2.65× 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: ScoringSpecModel engine/src/CodeHealth.Cli/Commands/ScoringSpecModel.cs— ClassTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 628 over it, 2.57× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: FrontendEngineDimensions engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs— ClassTooLong — 770 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 370 over it, 1.93× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: EventSourcingAnalyzer engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs— ClassTooLong — 662 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 262 over it, 1.66× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: ExplicitDebtAnalyzer engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs— ClassTooLong — 645 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 245 over it, 1.61× 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: SolutionShapeAnalyzer engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs— ClassTooLong — 569 significant lines (blank, comment-only and punctuation-only lines excluded), 14 methods. The bar is 400 significant lines; this is 169 over it, 1.42× 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: CommittedCoverageReader engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs— ClassTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 160 over it, 1.40× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: JsFunctionScanner engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs— ClassTooLong — 539 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods. The bar is 400 significant lines; this is 139 over it, 1.35× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: FrontendBundlerConfigRefs engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs— ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 27 methods. The bar is 400 significant lines; this is 93 over it, 1.23× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: DockerfileShapeRuleFilter engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs— ClassTooLong — 475 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 75 over it, 1.19× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: Emitter engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Emitter.java:52— ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 62 over it, 1.16× 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: DiskTestScanner engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs— ClassTooLong — 433 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 33 over it, 1.08× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: GodClassAnalyzer engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs— ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 22 methods. The bar is 400 significant lines; this is 32 over it, 1.08× 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: Emitter engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Emitter.kt:42— ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 47 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: SemgrepShapeFilter engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepShapeFilter.cs— ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: FrontendScriptCommandRefs engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs— ClassTooLong — 426 significant lines (blank, comment-only and punctuation-only lines excluded), 18 methods. The bar is 400 significant lines; this is 26 over it, 1.07× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: FrontendTestAndDocRefs engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs— ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 10 over it, 1.03× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:141— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:141-145 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1085-1091 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1085` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `type` to `INamedTypeSymbol` in one and `Nm.ICodeType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1665— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1665-1674 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5144-5148 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1665` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:43— engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:43-47 | engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:146-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3015— engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3015-3020 | engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3356-3360 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3015` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:374— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:374-378 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:455-459 — 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 (5 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2393— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2393-2397 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2447-2451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6183— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6183-6187 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7588-7592 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6183` 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. 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 (5 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10415— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10415-10419 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10427-10431 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10415` 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. 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 (5 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:71— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:71-77 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:155-159 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:71` 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 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 (5 lines × 2) engine/src/CodeHealth.Core/CodeShape/PublishedSurfaceProbe.cs:251— engine/src/CodeHealth.Core/CodeShape/PublishedSurfaceProbe.cs:251-255 | engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1018-1022 — 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. 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 (5 lines × 2) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:528— engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:528-532 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6128-6132 — 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. 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 (5 lines × 2) engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs:252— engine/src/CodeHealth.Core/Dimensions/DimensionResult.cs:252-256 | engine/src/CodeHealth.Core/Scoring/MetaDimension.cs:127-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2198— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2198-2202 | engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:591-595 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:531— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:531-535 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:713-717 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:567— engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:567-571 | engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:714-718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:547— engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:547-551 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:735-739 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:547` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:733` calls `foreach` and `engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:546` 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 (16 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpBranchExtractor.cs:288— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpBranchExtractor.cs:288-303 | engine/src/CodeHealth.Core/Complexity/CognitiveComplexityCalculator.cs:97-112 — 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 `engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpBranchExtractor.cs:288` 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 (16 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5815— engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5815-5830 | engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5864-5879 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5815` 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. 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 (16 lines × 2) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2158— engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2158-2173 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:753-768 — 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 `engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2158` 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 (16 lines × 2) engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:317— engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:317-332 | engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:428-443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:317` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) engine/src/CodeHealth.Reporting/Findings/FindingsSummaryBuilder.cs:136— engine/src/CodeHealth.Reporting/Findings/FindingsSummaryBuilder.cs:136-151 | engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1683-1698 — 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. 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 (16 lines × 2) engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:123— engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:123-138 | engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:155-170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:123` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `current` to `RunSidecar` in one and `IReadOnlyList<string> Cleared) NewAndClearedLabels(RunSidecar` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 2) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:696— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:696-711 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:755-770 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:696` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5362— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5362-5377 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5730-5745 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5362` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5729` calls `FullPath` and `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5361` 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 (16 lines × 2) src/Kennel.Watchdog.Core/Agents/Ui/RepoAutomation.razor:233— src/Kennel.Watchdog.Core/Agents/Ui/RepoAutomation.razor:233-248 | src/Kennel.Watchdog.Core/Security/Ui/RepoThreatModel.razor:267-282 — 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 `src/Kennel.Watchdog.Core/Agents/Ui/RepoAutomation.razor:233` 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. 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 (16 lines × 2) src/Kennel.Core/Questionnaires/Ui/ExamRunner.razor:281— src/Kennel.Core/Questionnaires/Ui/ExamRunner.razor:281-296 | src/Kennel.Core/Questionnaires/Ui/ReviewRunner.razor:545-560 — 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 `src/Kennel.Core/Questionnaires/Ui/ExamRunner.razor:281` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16 lines × 2) src/Kennel.Admin.Core/Admin/Ui/Corpus.razor:149— src/Kennel.Admin.Core/Admin/Ui/Corpus.razor:149-169 | src/Kennel.Admin.Core/Admin/Ui/CorpusCoverage.razor:108-123 — 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.
Duplicated block (16 lines × 2) engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:313— engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:313-328 | engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:426-441 — 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 (16 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:590— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:590-605 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:576-591 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:572` calls `IsDunder`, `StartsWith`, `EndsWith` and `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:586` 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 (16 lines × 2) engine/src/CodeHealth.Core/Classification/RustInlineTestModule.cs:356— engine/src/CodeHealth.Core/Classification/RustInlineTestModule.cs:356-371 | engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:399-414 — 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. 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 (16 lines × 2) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:2659— engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:2659-2674 | engine/src/CodeHealth.Core/Testing/TestProjectClassifier.cs:257-272 — 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.
TodoComment engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:291— // and load-confidence degradation. TODO(security): wire those before enabling provisioning in production. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:107— // the same way — the owner cannot move another project's TODO to their tracker, and editing the tree — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:219— // (B-WPFUI-D17-XAML-TODO). See MarkupTaskCommentScanner and RazorCodeBlockProjection. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/ModelAware/EnvironmentSeparationAnalyzer.cs:81— // TODO(SelectYesAsync): `separated == false` is NOT distinguishable from "the model did not answer for this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/ModelAware/ModelAwareLlmJudge.cs:376— // recorded as a known defect at the LA4 call site (EnvironmentSeparationAnalyzer, TODO(SelectYesAsync)), — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/ModelAware/SecurityPolicyAnalyzer.cs:55— // TODO(SelectYesAsync): `real == false` is NOT distinguishable from "the model did not answer for this item". — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Core/Scoring/DimensionEnforcementKeywords.cs:168— // threshold compare, `::error::`, `exit 1`). Anchored enough that a plain "TODO: …" comment (stripped by the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:403— // rows, every one a `.cs` path — against a repository carrying 879 TODO occurrences in `.ts` versus 640 in — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:630— // The same two exclusions the Roslyn path applies at `deductible`, for the same reasons: upstream's TODO is — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:742— // the first few suppressions per file, then dampen logarithmically. Every other debt kind (TODO, commented-out — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:413— // — "sbom" must be a whole path segment or a whole artifact-name value — so PROSE ("# TODO: add an SBOM later", a — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment engine/src/CodeHealth.Reporting/FileQuality/FileQualityScorer.cs:61— // "one TODO → 6.x", never 0.0/Critical — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/Kennel.Assay.Core/DecisionReports/Ui/CodebaseDetail.razor:241— // earlier hand-rolled, host-wide gate). SECURITY-TODO: the WRITE side of registry tenancy — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:158— engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:158-164 | engine/src/CodeHealth.Reporting/Architecture/DsmHtml.cs:357-363 — 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 `engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:158` 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) engine/src/CodeHealth.Core/ModelAware/ArchitectureStyleDetector.cs:72— engine/src/CodeHealth.Core/ModelAware/ArchitectureStyleDetector.cs:72-78 | engine/src/CodeHealth.Core/ModelAware/ArchitectureStyleDetector.cs: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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:214— engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:214-220 | engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4656-4669 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:92— engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:92-99 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:100-106 — both copies are in the same file, so extract the 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) engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:157— engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:157-163 | engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:169-175 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:157` 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) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2937— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2937-2943 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3291-3300 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:588— src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:588-594 | src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:612-618 — both copies are in the same file, so extract the 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 `src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:588` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:596` calls `Add` and `src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingNoise.razor:621` 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 (7 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/AttributeConsumptionScanner.cs:384— engine/src/CodeHealth.Core/ExplicitDebt/AttributeConsumptionScanner.cs:384-390 | engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1828-1834 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:4742— engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:4742-4751 | engine/src/CodeHealth.Core/Testing/FSharpTestProjectScanner.cs:157-163 — 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. 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 (7 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1032— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1032-1038 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:388-394 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:380— engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:380-386 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1744-1750 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7511— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7511-7520 | engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs: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. 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 (7 lines × 2) src/Kennel.Admin.Core/Admin/Ui/LanguageTraining.razor:683— src/Kennel.Admin.Core/Admin/Ui/LanguageTraining.razor:683-689 | src/Kennel.Admin.Core/Admin/Ui/LanguageTrainingLanguages.razor:355-361 — 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 (17 lines × 2) engine/src/CodeHealth.Core/Architecture/ProjectSizeAnalyzer.cs:202— engine/src/CodeHealth.Core/Architecture/ProjectSizeAnalyzer.cs:202-218 | engine/src/CodeHealth.Dimensions.Docs/AdrConformanceAnalyzer.cs:189-205 — 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 (17 lines × 2) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:3723— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:3723-3739 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6503-6519 — 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 (17 lines × 2) engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:129— engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:129-145 | engine/src/CodeHealth.Core/Dependencies/UnityPackageHygiene.cs:136-152 — 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 `engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) engine/src/CodeHealth.Core/Discovery/UnityProjectPresence.cs:170— engine/src/CodeHealth.Core/Discovery/UnityProjectPresence.cs:170-187 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:1543-1559 — 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 `engine/src/CodeHealth.Core/Discovery/UnityProjectPresence.cs:170` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:653— engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:653-669 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsValueFlow.cs:122-138 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:653` 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 (17 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1590— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1590-1613 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5002-5018 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1590` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1614` calls `Add`, `RepositoryTypeKey` and `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5019` 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 (17 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:547— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:547-563 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:355-371 — 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 `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:547` 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 (17 lines × 2) engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:379— engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:379-395 | engine/src/CodeHealth.Dimensions.Security/Scanners/NginxDirectiveRecheck.cs:337-353 — 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 `engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:379` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17 lines × 2) engine/src/CodeHealth.Toolchain/Git/GitTrackedPaths.cs:30— engine/src/CodeHealth.Toolchain/Git/GitTrackedPaths.cs:30-46 | engine/src/CodeHealth.Toolchain/Git/GitTrackedPaths.cs:58-74 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Toolchain/Git/GitTrackedPaths.cs:30` 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 (17 lines × 2) engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:55— engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:55-71 | engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrEvaluator.cs:73-89 — 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 `engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:55` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrEvaluator.cs:73` calls `Increment` and `engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:55` does not — after which the two agree again for 5 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 (17 lines × 2) engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:90— engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:90-106 | engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs:103-119 — before extracting anything, compare `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs` and `engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs:99` calls `Fail` and `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:86` 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 (17 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:3007— engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:3007-3023 | engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:1470-1486 — 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) engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:603— engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:603-610 | engine/src/CodeHealth.Core/ModelAware/GdprPersonalDataAnalyzer.cs:319-326 — 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) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:28— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:28-36 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:91-98 — 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 `engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs: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.
Duplicated block (8 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:789— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:789-796 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1794-1801 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:789` 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) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/PlaywrightAuthSetupLocator.cs:18— engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/PlaywrightAuthSetupLocator.cs:18-25 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestSuiteCommandBuilder.cs:29-36 — 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 `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/PlaywrightAuthSetupLocator.cs:18` 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) engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:350— engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:350-357 | engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:428-435 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:350` 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) engine/src/CodeHealth.Dimensions.Security/Scanners/CurlPipeShellSourceRecheck.cs:269— engine/src/CodeHealth.Dimensions.Security/Scanners/CurlPipeShellSourceRecheck.cs:269-276 | engine/src/CodeHealth.Dimensions.Security/Scanners/LoopbackAddressRecheck.cs:28-35 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/CurlPipeShellSourceRecheck.cs:269` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2982— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2982-2989 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3337-3347 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2982` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (8 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5181— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5181-5188 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5256-5263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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. 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 (8 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9138— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9138-9145 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9154-9161 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9138` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10663— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10663-10670 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10684-10691 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10663` 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. 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. 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 (8 lines × 2) src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:532— src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:532-539 | src/Kennel.Core/Deliveries/Ui/SellerDeliveries.razor:258-265 — 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 `src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:532` 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 × 2) src/Kennel.Assay.Core/Governance/Ui/BarDetail.razor:202— src/Kennel.Assay.Core/Governance/Ui/BarDetail.razor:202-209 | src/Kennel.Assay.Core/Governance/Ui/GovernanceBars.razor:170-177 — 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 `src/Kennel.Assay.Core/Governance/Ui/BarDetail.razor:202` 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· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1741— engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1741-1824 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1875-1929 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1950-2019 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2026-2095 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2257-2328 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:260— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:260-297 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:265-275 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:249-259 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:400-438 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:406-416 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:508— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:508-527 | engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1640-1659 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:218-237 | engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:252-271 | engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:284-322 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:666— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:666-682 | engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:717-734 | engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3250-3269 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1517-1538 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyDuplicateMethodDefinitionScan.cs:292-308 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:117— engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:117-124 | engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:126-135 | engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:144-151 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:271-280 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:130-137 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:938— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:938-967 | engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:380-409 | engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:814-839 | engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:115-144 | engine/src/CodeHealth.Core/Frontend/NonProductionTreeReadmission.cs:169-198 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:147— engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:147-190 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:87-341 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:74-303 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:120-230 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:669-766 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3644— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3644-3695 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3967-4008 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4015-4053 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4063-4105 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4116-4153 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Security/Scanners/PrivateKeyBlobHistoryScan.cs:532— engine/src/CodeHealth.Dimensions.Security/Scanners/PrivateKeyBlobHistoryScan.cs:532-538 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:2424-2430 | engine/src/CodeHealth.Toolchain/Git/GitDiffShapes.cs:479-485 | engine/src/CodeHealth.Toolchain/Git/GitLogHistoryExtractor.cs:254-260 | engine/src/CodeHealth.Toolchain/Git/LibGit2GitAccessor.cs:351-357 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4169— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4169-4184 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4191-4207 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4257-4275 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4282-4300 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4366-4386 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:87— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:87-153 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:68-133 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:81-212 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:74-135 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:76-142 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (18 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:56— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:56-73 | engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:50-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 `engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:56` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:77` calls `Append` and `engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:69` 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 (18 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:125— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:125-142 | engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:135-152 — 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 `engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:125` 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. 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 (18 lines × 2) engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:126— engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:126-143 | engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:76-93 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:126` 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. 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 (18 lines × 2) engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:100— engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:100-118 | engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:200-217 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:100` 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 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. 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 (18 lines × 2) engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:453— engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:453-470 | engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:982-999 — 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 `engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:453` 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 (18 lines × 2) engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:276— engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:276-293 | engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:389-406 — 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 `engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 2) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:539— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:539-556 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:721-738 — 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 (18 lines × 2) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:350— engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:350-368 | engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1119-1136 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:350` 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 (18 lines × 2) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:412— engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:412-429 | engine/src/CodeHealth.Core/Testing/CoverageReportAdvice.cs:420-437 — 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 (18 lines × 2) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1180— engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1180-1197 | engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1300-1317 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1180` 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. 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. 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 (11 lines × 3) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:265— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:265-275 | engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:249-259 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:406-416 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:261` calls `foreach` and `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:277` 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 (11 lines × 3) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:668— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:668-678 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1524-1534 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyDuplicateMethodDefinitionScan.cs:294-304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Security/Scanners/RubyDuplicateMethodDefinitionScan.cs:291` calls `MentionsMethod` and `engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1521` 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 × 3) engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:138— engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:138-148 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:283-293 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:140-150 — 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 `engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:138` 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 × 3) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582-2592 | engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:191-201 | engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:517-527 — 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 `engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2582` 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 × 3) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:595— engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:595-605 | engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:519-530 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:332-343 — 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 `engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:595` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:34— engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:34-57 | engine/src/CodeHealth.Dimensions.Architecture/ProjectCohesionAnalyzer.cs:43-56 | engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs:35-45 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:34` 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. 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. 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 (11 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:54— engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:54-65 | engine/src/CodeHealth.Dimensions.Security/Scanners/EolActionMajorRepositoryFold.cs:132-142 | engine/src/CodeHealth.Dimensions.Security/Scanners/KsvSecurityContextAggregator.cs:75-87 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:54` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:53` calls `RuleName` and `engine/src/CodeHealth.Dimensions.Security/Scanners/EolActionMajorRepositoryFold.cs:130` 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 (11 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:104— engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:104-114 | engine/src/CodeHealth.Dimensions.Security/Scanners/PythonInstallGuardDisabledScan.cs:196-206 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs: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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:104` 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 × 3) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:386— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:386-396 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2745-2755 | engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:3125-3135 — 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. 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 (20 lines × 2) engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:504— engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:504-523 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:238-257 — 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 (20 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:781— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:781-800 | engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:865-884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:781` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (20 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1159— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1159-1178 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3519-3538 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1159` 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. 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 (20 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1023— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1023-1045 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2317-2336 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1023` 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, `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2338` calls `DeclaredConstantsByType`, `Select` and `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1047` 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 (20 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1358— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1358-1377 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1448-1467 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1358` 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 (20 lines × 2) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:2186— engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:2186-2205 | engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:518-537 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:518` 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. 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 (20 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:259— engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:259-278 | engine/src/CodeHealth.Dimensions.Security/Scanners/NamespaceScopedRuleAggregator.cs:314-333 — 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 (20 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:196— engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:196-215 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:530-549 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:196` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `lines` to `IReadOnlyList<string>` in one and `int JudgeableClauses) GroupingAxes(IReadOnlyList<string>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×7
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:193— engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:193-233 | engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:159-199 | engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:177-215 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:175-211 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:305-347 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:162-205 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1456— engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1456-1519 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:426-488 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5830-5884 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5970-6017 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6213-6272 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9916-9994 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1371— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1371-1404 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1436-1469 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1501-1534 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1554-1593 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1601-1634 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1847-1880 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Architecture/BoundaryScopeJudge.cs:68— engine/src/CodeHealth.Dimensions.Architecture/BoundaryScopeJudge.cs:68-75 | engine/src/CodeHealth.Dimensions.Architecture/Llm/LlmApiConsistencyEvaluator.cs:79-86 | engine/src/CodeHealth.Dimensions.Architecture/Llm/LlmProjectCohesionEvaluator.cs:57-64 | engine/src/CodeHealth.Dimensions.Docs/Llm/PromptResource.cs:10-17 | engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:906-913 | engine/src/CodeHealth.Reporting/Prose/LlmReportProseGenerator.cs:253-260 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:348— engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:348-370 | engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:380-424 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:106-155 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:876-909 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1329-1370 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1375-1397 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:195— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:195-244 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:300-349 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:619-668 | engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadPrivilegedScan.cs:258-313 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubySourceFiles.cs:33-83 | engine/src/CodeHealth.Dimensions.Security/Scanners/WranglerPlaintextVarScan.cs:395-444 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:39— engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:39-69 | engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:84-113 | engine/src/CodeHealth.Dimensions.Security/Scanners/ShellCommandPrefixRecheck.cs:95-125 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:138-167 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs:93-122 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedShellInstallerRecheck.cs:90-119 — These 6 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 6 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 6 times.
Duplicated block (21 lines × 2) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CrossplaneExtractor.cs:139— engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CrossplaneExtractor.cs:139-159 | engine/src/CodeHealth.Core/Architecture/Topology/Extractors/KubernetesExtractor.cs:83-103 — 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 (21 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7704— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7704-7724 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5310-5330 — 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7704` 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. 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 (21 lines × 2) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:46— engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:46-66 | engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:67-87 — 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 `engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:46` 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 (21 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2139— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2139-2159 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2207-2227 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2139` 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. 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 (21 lines × 2) engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121— engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121-141 | engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:124-144 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs` and `engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 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 `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121` 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 (21 lines × 2) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:243— engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:243-263 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:670-690 — 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 `engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:243` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:692` calls `IsFrontendFamilyExtension`, `GetExtension` and `engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:265` 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 × 4) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1812— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1812-1822 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1869-1879 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1895-1905 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1922-1932 — 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1812` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:48— engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:48-64 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:95-105 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs:150-166 | engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:372-388 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs` and `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs` as WHOLE FILES: this scan already matched 3 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. 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 `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:48` 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. 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 (11 lines × 4) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1412— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1412-1422 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1477-1487 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1642-1652 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1750-1760 — 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 `engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:613— engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:613-623 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:690-700 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:749-759 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1783-1793 — 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 `engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:613` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:114— engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:114-124 | engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:161-171 | engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:108-118 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnresolvableImageReferenceScan.cs:89-99 — 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. 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 (11 lines × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:138— engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:138-148 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyDuplicateMethodDefinitionScan.cs:97-107 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyRescueDiscardsCaughtErrorScan.cs:123-133 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:167-177 — 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. 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 × 3) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:57— engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:57-64 | engine/src/CodeHealth.Core/ModelAware/DataShapeSmellAnalyzer.cs:52-59 | engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:78-85 — 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 `engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:57` 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. 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 × 3) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:870— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:870-877 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:930-937 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:994-1001 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:870` 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. 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 (8 lines × 3) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6268— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6268-6276 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6308-6316 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6781-6788 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 3) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4005— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4005-4012 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4064-4071 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4692-4699 — 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. 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. 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, `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4005` calls `GetFileName` and `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4064` does not — after which the two agree again for 5 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 × 3) engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:258— engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:258-269 | engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs:336-347 | engine/src/CodeHealth.Core/ModelAware/PerformanceAnalyzer.cs:642-649 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 × 3) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:330— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:330-340 | engine/src/CodeHealth.Dimensions.Security/RuntimeHardeningScan.cs:254-264 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:4890-4897 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `tokens` to `params string[]` in one and `string[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Medium: unsafe-path-combine engine/src/CodeHealth.Core/Testing/NodeBrowserProvision.cs:195— String argument shimDir is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: unsafe-path-combine engine/src/CodeHealth.Core/Testing/NodeWorkspaceSiblingBuilder.cs:132— String argument dir is used to read or write data from a file via Path.Combine without direct sanitization via Path.GetFileName. If the path is user-supplied data this can lead to path traversal.
Medium: watchdog-module-specifier-built-from-environment-ts tools/localdev/e2e/portfolio-first-scan-parity.cjs:20— The module loaded here is chosen by an environment variable: the specifier handed to this `import()`/`require()` is built from `process.env`, so which file the program loads -- and whether that file exists at all -- is decided by the deployment's environment at the moment this line runs, not by anything the compiler, the bundler or the test suite can check. A value that is unset, misspelt or new (a `staging` deployment beside an `envs/` directory that holds development and production) is not a configuration error the code can report: it is a module-resolution failure at boot, or the wrong module loaded when a fallback quietly substitutes a default. Enumerate the values the code accepts and load each with a literal specifier -- a `switch` or a map from the environment value to a static `import`/`require` -- so an unknown value is refused where it is read and every reachable module is one the toolchain can see. Where a path from the environment really is the contract, as for an operator-supplied plugin, check that it exists or handle the load's failure before the loader reports it. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: watchdog-module-specifier-built-from-environment-ts tools/localdev/e2e/repo-hub-hover.cjs:31— The module loaded here is chosen by an environment variable: the specifier handed to this `import()`/`require()` is built from `process.env`, so which file the program loads -- and whether that file exists at all -- is decided by the deployment's environment at the moment this line runs, not by anything the compiler, the bundler or the test suite can check. A value that is unset, misspelt or new (a `staging` deployment beside an `envs/` directory that holds development and production) is not a configuration error the code can report: it is a module-resolution failure at boot, or the wrong module loaded when a fallback quietly substitutes a default. Enumerate the values the code accepts and load each with a literal specifier -- a `switch` or a map from the environment value to a static `import`/`require` -- so an unknown value is refused where it is read and every reachable module is one the toolchain can see. Where a path from the environment really is the contract, as for an operator-supplied plugin, check that it exists or handle the load's failure before the loader reports it. This is a semgrep security-AUDIT rule: it reports that a sensitive construct is present, not that it is exploitable here. Confirm whether this site handles untrusted input or is reachable across a trust boundary — and apply the change where it is; where the construct is required by the platform or protocol it calls into, and carries no untrusted data (a syscall/FFI shim, a build- or debug-gated tool, a fixed local surface), record the review and leave the code as it is.
Medium: allow-privilege-escalation tools/train/backlog-sessions/01a07fdf-03e3-7216-99a2-98ac561ed478/fixture-service.yaml:11— In Kubernetes, each pod runs in its own isolated environment with its own set of security policies. However, certain container images may contain `setuid` or `setgid` binaries that could allow an attacker to perform privilege escalation and gain access to sensitive resources. To mitigate this risk, it's recommended to add a `securityContext` to the container in the pod, with the parameter `allowPrivilegeEscalation` set to `false`. This will prevent the container from running any privileged processes and limit the impact of any potential attacks. By adding the `allowPrivilegeEscalation` parameter to your the `securityContext`, you can help to ensure that your containerized applications are more secure and less vulnerable to privilege escalation attacks.
Duplicated block (19 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:95— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:95-113 | engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:109-127 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (19 lines × 2) engine/src/CodeHealth.Core/ModelAware/BodyModelLookup.cs:16— engine/src/CodeHealth.Core/ModelAware/BodyModelLookup.cs:16-34 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:511-529 — 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 (19 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2458— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2458-2476 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2691-2709 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2458` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19 lines × 2) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:481— engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:481-499 | engine/src/CodeHealth.Core/CodeShape/NeutralTypeLengthScanner.cs:150-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:475` calls `PathsMatch`, `Replace`, `Equals` and `engine/src/CodeHealth.Core/CodeShape/NeutralTypeLengthScanner.cs:145` 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 (19 lines × 2) engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:840— engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:840-858 | engine/src/CodeHealth.Core/Testing/NodeTestSuiteProbe.cs:180-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. 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 (12 lines × 3) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:94— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:94-108 | engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:187-198 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:86-97 — 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. 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, `engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:91` calls `CommonDirectoryPrefixLength` and `engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:81` 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 × 3) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3244— engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3244-3255 | engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3274-3285 | engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3388-3399 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3244` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:46— engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:46-63 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:93-104 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs:148-165 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs` and `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs` as WHOLE FILES: this scan already matched 3 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. 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 `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:46` 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. 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 (12 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349— engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349-360 | engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:381-392 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1376-1387 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 3) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:6780— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:6780-6791 | engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:333-344 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:256-267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:437— engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:437-446 | engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:676-685 | engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:826-835 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Diagnostics/ScanBudgets.cs:437` 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. 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 (10 lines × 3) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:473— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:473-482 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2020-2029 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2033-2042 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:496— engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:496-506 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1403-1412 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1638-1647 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `method` to `IMethodSymbol` in one and `Nm.IMethod` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 3) engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:847— engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:847-856 | engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:1056-1065 | engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:1199-1208 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:847` 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 × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:429— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:429-438 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:495-504 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:532-541 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 3) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1457— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1457-1462 | engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2623-2628 | engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2630-2635 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:157— engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:157-162 | engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:160-165 | engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:165-170 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs` and `engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 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 `engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:157` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:916— engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:916-921 | engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:1004-1009 | engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:1070-1075 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:1070` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:913` calls `Where`, `IsNullOrEmpty`, `GroupBy` and `engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:1068` 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 (6 lines × 3) engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:33— engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:33-38 | engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:27-32 | engine/src/CodeHealth.Dimensions.GitMining/HotspotAnalyzer.cs:56-63 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:33` calls `Join`, `Select`, `TrimStart` and `engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:27` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:534— src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:534-539 | src/Kennel.Core/Deliveries/Ui/SellerDeliveries.razor:260-265 | src/Kennel.Watchdog.Core/Customers/Ui/Customers.razor:241-246 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Kennel.Core/Deliveries/Ui/RepoEvidence.razor:534` 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.
codehealth_rust_sidecar::var_prefixes (cyclomatic 21) engine/sidecars/rust-frontend/src/main.rs:2765— codehealth_rust_sidecar::var_prefixes 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.
codehealth_rust_sidecar::substitute_template (cyclomatic 21) engine/sidecars/rust-frontend/src/main.rs:2951— codehealth_rust_sidecar::substitute_template 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.
codehealth_rust_sidecar::select_arms (cyclomatic 19) engine/sidecars/rust-frontend/src/main.rs:4385— codehealth_rust_sidecar::select_arms 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.
codehealth_rust_sidecar::main (cyclomatic 17) engine/sidecars/rust-frontend/src/main.rs:23— codehealth_rust_sidecar::main 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.
(anonymous)::lcApply (cognitive 36) src/Kennel.Ui/wwwroot/kennel-ui.js:778— (anonymous)::lcApply has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (15 pts), ternaries 5 (12 pts), boolean chains 9 (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
(anonymous)::(anonymous)::describe (cognitive 28) src/Kennel.Ui/wwwroot/kennel-ui.js:974— (anonymous)::(anonymous)::describe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (14 pts), ternaries 4 (9 pts), boolean chains 5 (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.
(anonymous)::onLifecycle (cognitive 17) src/Kennel.Ui/wwwroot/kennel-ui.js:2010— (anonymous)::onLifecycle has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (7 pts), error handling 2 (4 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous)::renderDelta (cognitive 16) src/Kennel.Ui/wwwroot/kennel-ui.js:1535— (anonymous)::renderDelta has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 4, ternaries 3. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Change coupling: IMetricsReader.cs ↔ MetricPoint.cs src/Kennel.Core/Metrics/Contracts/IMetricsReader.cs— `src/Kennel.Core/Metrics/Contracts/IMetricsReader.cs` and `src/Kennel.Core/Metrics/Domain/MetricPoint.cs` change together 91% of the time (10 of the 11 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `bc90d938` fix(corpus): only a full scan is publishable; `8c5f85ed` feat(coverage): engine gaps reach the wire, the store and the run-his…; `e2069206` fix(w8): ship the file-quality percentages with their denominator — run `git show` on any of them.
Change coupling: NoiseSplit.cs ↔ AdvisoryCatalog.cs src/Kennel.Core/LanguageTraining/Services/NoiseSplit.cs— `src/Kennel.Core/LanguageTraining/Services/NoiseSplit.cs` and `src/Kennel.Core/Repositories/Advisory/AdvisoryCatalog.cs` change together 69% of the time (9 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `6b68b05c` fix(advisory): the four Runtime Evidence cards are declared advisory …; `22e2210b` fix(dm9): declare the dimension everywhere it has to be declared; `7e0bee07` fix(X32): adding a dimension is a TWO-repository change, and 9c5dcfa1… — run `git show` on any of them.
Change coupling: BillingDbContext.cs ↔ ICommercialCatalog.cs src/Kennel.Core/Billing/Persistence/BillingDbContext.cs— `src/Kennel.Core/Billing/Persistence/BillingDbContext.cs` and `src/Kennel.Core/Commercial/Contracts/ICommercialCatalog.cs` change together 55% of the time (6 of the 11 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `93da3467` feat(pricing): a bucket can require modules, which confines it to one…; `da9f0560` feat(billing): close the Stripe go-live gaps — real cancel, in-place …; `224cc995` feat(billing): simplify Assay pricing to the module-modifier model — … — run `git show` on any of them.
Change coupling: BillingDbContext.cs ↔ EfCommercialCatalog.cs src/Kennel.Core/Billing/Persistence/BillingDbContext.cs— `src/Kennel.Core/Billing/Persistence/BillingDbContext.cs` and `src/Kennel.Core/Commercial/Services/EfCommercialCatalog.cs` change together 50% of the time (6 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `93da3467` feat(pricing): a bucket can require modules, which confines it to one…; `da9f0560` feat(billing): close the Stripe go-live gaps — real cancel, in-place …; `224cc995` feat(billing): simplify Assay pricing to the module-modifier model — … — run `git show` on any of them.
Duplicated block (24 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:297— engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:297-320 | engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:551-574 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:297` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (24 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:128— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:128-151 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeMutableServiceImageScan.cs:141-164 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:128` 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 (24 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1323— engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1323-1346 | engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1358-1381 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1323` 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. 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 (24 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3841— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3841-3864 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3888-3911 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3841` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 2) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1924— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1924-1945 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:305-326 — 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 `engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1924` 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. 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 (22 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:817— engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:817-838 | engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:122-143 — 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 (22 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3531— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3531-3552 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3766-3787 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3531` 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 (22 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:147— engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:147-168 | engine/src/CodeHealth.Dimensions.Security/Scanners/ShellCommandPrefixRecheck.cs:168-189 — 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 (18–19 lines × 2) engine/src/CodeHealth.Core/CodeShape/Subsumption.cs:74— engine/src/CodeHealth.Core/CodeShape/Subsumption.cs:74-91 | engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:359-377 — 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 `engine/src/CodeHealth.Core/CodeShape/Subsumption.cs:74` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note first that the copies are not typed on the same thing: the declarations holding them bind `strong` to `SubsumptionOperand` in one and `Pred` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1643— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1643-1660 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5121-5139 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1643` 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 (18–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:393— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:393-411 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1080-1097 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:393` 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 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18–19 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7664— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7664-7681 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8235-8253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:8296— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:8296-8310 | engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:747-762 — 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:8296` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:541— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:541-555 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:173-188 — 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 `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:541` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileHardeningAdvice.cs:63— engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileHardeningAdvice.cs:63-78 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileHardeningAdvice.cs:320-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileHardeningAdvice.cs:63` 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–16 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2568— engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2568-2582 | engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2648-2663 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2568` 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. 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 (5 lines × 3) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:619— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:619-624 | engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:670-674 | engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:709-713 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3869— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3869-3873 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4305-4309 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4368-4372 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3869` 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 × 3) engine/src/CodeHealth.Reporting/Changelog/ChangelogRenderer.cs:219— engine/src/CodeHealth.Reporting/Changelog/ChangelogRenderer.cs:219-223 | engine/src/CodeHealth.Reporting/Changelog/ChangelogRenderer.cs:317-321 | engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:190-194 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Reporting/Changelog/ChangelogRenderer.cs:219` 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. 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 (5 lines × 3) engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:361— engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:361-369 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7210-7214 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10633-10637 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. 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.
(anonymous)::lcApply (cyclomatic 23) src/Kennel.Ui/wwwroot/kennel-ui.js:778— (anonymous)::lcApply 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.
(anonymous)::(anonymous)::describe (cyclomatic 17) src/Kennel.Ui/wwwroot/kennel-ui.js:974— (anonymous)::(anonymous)::describe has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
(anonymous)::renderDelta (cyclomatic 17) src/Kennel.Ui/wwwroot/kennel-ui.js:1535— (anonymous)::renderDelta has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Model::resolve (cognitive 44) engine/sidecars/rust-frontend/src/main.rs:1095— Model::resolve has cognitive complexity 44 (threshold 15). Drivers by points: loops 14 (25 pts), if/else 7 (18 pts), boolean chains 1 (nesting depth added 22). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Model::emit_type (cognitive 32) engine/sidecars/rust-frontend/src/main.rs:1296— Model::emit_type has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 6 (8 pts), boolean chains 5, 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.
Model::resolve_impl_owner (cognitive 20) engine/sidecars/rust-frontend/src/main.rs:980— Model::resolve_impl_owner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (27 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:250— engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:250-276 | engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:58-84 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:250` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (27 lines × 2) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1504— engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1504-1530 | engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1618-1644 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1504` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (27 lines × 2) engine/src/CodeHealth.Dimensions.Security/SecretScanningAnalyzer.cs:254— engine/src/CodeHealth.Dimensions.Security/SecretScanningAnalyzer.cs:254-280 | engine/src/CodeHealth.Dimensions.Security/SecretScanningAnalyzer.cs:304-330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (16 lines × 3) engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:252— engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:252-267 | engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:149-164 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2022-2037 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2022` 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. 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 (16 lines × 3) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:704— engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:704-719 | engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3403-3418 | engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepUnsafeAdvice.cs:277-292 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 (16 lines × 3) engine/src/CodeHealth.Core/ModelAware/ElixirDomainConventions.cs:328— engine/src/CodeHealth.Core/ModelAware/ElixirDomainConventions.cs:328-343 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:563-578 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:775-790 — 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. 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 (15 lines × 3) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3532— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3532-3546 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3593-3607 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3767-3781 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3532` 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 × 3) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1871— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1871-1885 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1897-1911 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1924-1938 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1871` 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 × 3) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:75— engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:75-89 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:171-185 | engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:211-225 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:75` 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. 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 (13–14 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5352— engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5352-5365 | engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5761-5773 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:103— engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:103-115 | engine/src/CodeHealth.Dimensions.Security/Scanners/PythonInstallGuardDisabledScan.cs:194-207 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:76— engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:76-88 | engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:197-210 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:76` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 3) engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:149— engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:149-161 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:241-253 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:671-683 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (13 lines × 3) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4714— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4714-4726 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:432-444 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnscopedBuildContextCopyScan.cs:299-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4714` 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 (13 lines × 3) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8280— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8280-8292 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8367-8379 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8639-8651 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8280` 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. 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 (10 lines × 4) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93-102 | engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:106-115 | engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:186-195 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:85-94 — 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 `engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:91` calls `CommonDirectoryPrefixLength` and `engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:81` 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 (10 lines × 4) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2583— engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2583-2592 | engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:192-201 | engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:518-527 | engine/src/CodeHealth.Core/Frontend/ModuleGlobPattern.cs:64-73 — 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 `engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2583` 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 × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/CloudFrontDefaultCertificateAdvice.cs:98— engine/src/CodeHealth.Dimensions.Security/Scanners/CloudFrontDefaultCertificateAdvice.cs:98-107 | engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:242-253 | engine/src/CodeHealth.Dimensions.Security/Scanners/SpringSecurityActuatorRecheck.cs:241-250 | engine/src/CodeHealth.Dimensions.Security/Scanners/TerraformVariableDefaultFilter.cs:280-289 — 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.
Off the main sequence: CodeHealth.Toolchain — CodeHealth.Toolchain: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: CodeHealth.Llm.Abstractions — CodeHealth.Llm.Abstractions: abstractness 0.18, instability 0.00, distance 0.82 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: CodeHealth.Core — CodeHealth.Core: abstractness 0.07, instability 0.12, distance 0.81 — zone of pain — concrete and depended on by 15 project(s), so it's rigid to change.
Model::emit_type (cyclomatic 24) engine/sidecars/rust-frontend/src/main.rs:1296— Model::emit_type 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.
Model::resolve (cyclomatic 23) engine/sidecars/rust-frontend/src/main.rs:1095— Model::resolve has cyclomatic complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Tokenizer.blankLiterals (cyclomatic 20) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Tokenizer.kt:174— Tokenizer.blankLiterals 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.
Tokenizer.blankLiterals (cyclomatic 20) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Tokenizer.scala:146— Tokenizer.blankLiterals 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.
AmbientInputAnalyzer.Analyze (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/AmbientInputAnalyzer.cs:98— AmbientInputAnalyzer.Analyze has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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.
AmbientInputAnalyzer.Analyze (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/AmbientInputAnalyzer.cs:162— AmbientInputAnalyzer.Analyze has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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.
Prerelease dependency: Cai.Delivery — Cai.Delivery resolves to 0.1.3-ws-g, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
Prerelease dependency: Cai.Scoring — Cai.Scoring resolves to 0.1.3-ws-g, a prerelease build. Prerelease packages carry no support policy, may change breaking between previews and can be unlisted — pin a stable release before shipping, or record the reason this preview is required.
XxxComment engine/tests/CodeHealth.Tests.Unit/ExplicitDebt/RoslynExplicitDebtCollectorTests.cs:2235— // XXX is not the lead-in rule's to decide: it is also the redaction glyph, so IsLowercaseProseSlot answers the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment engine/tests/CodeHealth.Tests.Unit/ExplicitDebt/XxxProseSlotTests.cs:45— // GUARD — the gate is XXX-only: TODO/FIXME/HACK are not English words and never occupy a noun slot — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
MutationIdempotencyAnalyzer.DedupePipelines (cognitive 23) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:515— MutationIdempotencyAnalyzer.DedupePipelines has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationIdempotencyAnalyzer.DedupePipelines (cognitive 23) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:595— MutationIdempotencyAnalyzer.DedupePipelines has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationIdempotencyAnalyzer.EnvelopedCommands (cognitive 20) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:330— MutationIdempotencyAnalyzer.EnvelopedCommands has cognitive complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MutationIdempotencyAnalyzer.EnvelopedCommands (cognitive 20) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:386— MutationIdempotencyAnalyzer.EnvelopedCommands has cognitive complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MutationIdempotencyAnalyzer.MutationWrite (cognitive 20) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1133— MutationIdempotencyAnalyzer.MutationWrite has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.MutationWrite) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MutationIdempotencyAnalyzer.MutationWrite (cognitive 20) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1166— MutationIdempotencyAnalyzer.MutationWrite has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.MutationWrite) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Medium IaC: WD-DOCKER-0011 engine/docker/analyzer/Dockerfile:489— Line 489 sets `safe.directory` to `*` in this image's global git configuration, which turns OFF git's repository-ownership check for EVERY repository the running container is ever pointed at. That check is not a nuisance: git refuses to operate on a repository owned by another user precisely because a repository's own `.git/config` can execute commands — `core.pager`, `core.fsmonitor`, `core.sshCommand`, an `alias` — as soon as any ordinary git command runs inside it ([CVE redacted]). With the wildcard exemption in the image, a hostile `.git/config` in a bind-mounted host checkout, a shared volume or a clone left behind by another job executes as this container's user. This image's final stage also declares no unprivileged `USER`, so that execution is as ROOT inside the container, with root's capabilities over every path the mount exposes — the exemption and the account are two halves of the same hole, and fixing only the `USER` leaves the check disabled. Name the paths instead of the wildcard — `git config --global --add safe.directory /workspace` (repeat the flag per path) — so the image trusts the mount point it is designed for and nothing else. If the path is only known at run time, set it at run time from the entrypoint using the argument the container was actually given, rather than baking `*` into the image; `GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=safe.directory GIT_CONFIG_VALUE_0="$PWD"` scopes it to a single invocation without writing anything. If the image genuinely must accept any repository — a scanner or a CI runner is the usual reason — pair the exemption with a non-root `USER` and say here that the wildcard is deliberate, so a reader can tell a considered decision from a workaround for an ownership error.
Medium IaC: CKV_K8S_21 tools/train/backlog-sessions/01a07fdf-03e3-7216-99a2-98ac561ed478/fixture-service.yaml:1— The default namespace should not be used
Duplicated block (37 lines × 2) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:261— engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:261-297 | engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:402-438 — 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 `engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:402` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:401` calls `ThrowIfNull` and `engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:260` 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 (37 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:182— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:182-218 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:185-221 — 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 `engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:182` 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 (29 lines × 2) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:540— engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:540-568 | engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:574-602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (29 lines × 2) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:328— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:328-356 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:304-332 — before extracting anything, compare `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs` and `engine/src/CodeHealth.Core/Testing/RustTestCensus.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 183 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. 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 (28 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:33— engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:33-60 | engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:33-60 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:33` 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 (28 lines × 2) engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:333— engine/src/CodeHealth.Core/Markup/TemplMarkupProducer.cs:333-360 | engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:447-474 — 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 (27 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:68— engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:68-94 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:79-105 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs:63-89 — 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. 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 (27 lines × 3) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:101— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:101-127 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:88-114 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:90-116 — 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 `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:101` 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 (25–26 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:510— engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:510-534 | engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:573-598 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (25–26 lines × 2) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:295— engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:295-319 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:87-112 — 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. 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. 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 (25 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:826— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:826-850 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2350-2374 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:826` 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (25 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1688— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1688-1712 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5146-5170 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1688` 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 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 (23 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3661— engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3661-3683 | engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3818-3840 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3661` 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. 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 (23 lines × 2) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:592— engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:592-614 | engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:727-749 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:592` 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. 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. 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 (22–23 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:53— engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:53-74 | engine/src/CodeHealth.Dimensions.Security/Scanners/KsvSecurityContextAggregator.cs:74-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:53` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22–23 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:84— engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:84-105 | engine/src/CodeHealth.Dimensions.Security/Scanners/ShellCommandPrefixRecheck.cs:95-117 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 3) engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:427— engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:427-450 | engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:171-192 | engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:478-502 — 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 `engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:427` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22 lines × 3) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:70— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:70-91 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:63-84 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:68-89 — 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. 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 (19–21 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1306— engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1306-1326 | engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1392-1410 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1306` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–21 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyRescueDiscardsCaughtErrorScan.cs:346— engine/src/CodeHealth.Dimensions.Security/Scanners/RubyRescueDiscardsCaughtErrorScan.cs:346-364 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyUnreachableRescueClauseScan.cs:290-310 — 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 (20–21 lines × 2) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:764— engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:764-784 | engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1322-1341 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:764` 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. 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 (20–21 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:906— engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:906-925 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:951-971 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:906` 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 (20 lines × 3) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1514— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1514-1533 | engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:520-539 | engine/src/CodeHealth.Core/Frontend/ModuleGlobPattern.cs:66-85 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1514` 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. 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. 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 (20 lines × 3) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1240— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1240-1259 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1284-1303 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1328-1347 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1240` 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 (19–20 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3838— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3838-3856 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6303-6322 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3838` 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 (19–20 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:273— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:273-292 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:687-705 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:273` 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. 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 (19 lines × 3) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:509— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:509-527 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:219-237 | engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:253-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 (19 lines × 3) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:471— engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:471-489 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:465-483 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:645-663 — 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. 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 (16–19 lines × 2) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1402— engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1402-1420 | engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs:349-364 — 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 `engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1402` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:216— engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:216-231 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:564-582 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:216` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:238— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:238-256 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1599-1615 — both copies are in the same file, so extract the 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 first that the copies are not typed on the same thing: the declarations holding them bind `type` to `INamedTypeSymbol` in one and `Nm.ICodeType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (17–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:233— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:233-251 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:194-210 — 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:233` 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 (18 lines × 3) src/Kennel.Assay.Core/Billing/Ui/PlanChange.razor:117— src/Kennel.Assay.Core/Billing/Ui/PlanChange.razor:117-134 | src/Kennel.Core/Billing/Ui/OrgBranding.razor:107-124 | src/Kennel.Watchdog.Core/Billing/Ui/PlanChange.razor:186-203 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (18 lines × 3) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:468— engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:468-485 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:607-624 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:946-963 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:468` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:944` calls `IsTestsDir`, `HasConventionalTestDirSegment` and `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:466` 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 (17–18 lines × 2) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1980— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1980-1996 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3432-3449 — both copies are in the same file, so extract the 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.
Duplicated block (17–18 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:57— engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:57-73 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRedundantReDefaultRecheck.cs:56-73 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:57` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–15 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:973— engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:973-987 | engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:84-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:973` 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 (13–15 lines × 2) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:392— engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:392-404 | engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:4028-4042 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:392` 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 (14 lines × 5) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:508— engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:508-521 | engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1640-1653 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:218-231 | engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:252-265 | engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:298-311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:508` 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. 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. 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 (14 lines × 5) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4170— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4170-4183 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4192-4205 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4258-4271 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4283-4296 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4367-4381 — 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. 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4384` calls `FindSwiftSourceFiles` and `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4274` 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 (13 lines × 4) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:224— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:224-240 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:161-173 | engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:358-372 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:199-211 — 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 `engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:161` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:55— engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:55-67 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs:55-67 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRedundantReDefaultRecheck.cs:54-66 | engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs:50-62 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:55` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:120— engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:120-132 | engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:117-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 both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:120` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 2) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1140— engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1140-1151 | engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1322-1334 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 5) engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:148— engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:148-159 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:240-251 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:231-242 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:199-210 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:670-681 — 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 5 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:253` calls `BodyModelLookup` and `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:212` 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 (12 lines × 5) engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:43— engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:43-54 | engine/src/CodeHealth.Dimensions.Security/Scanners/RecursiveOwnershipRootRecheck.cs:88-99 | engine/src/CodeHealth.Dimensions.Security/Scanners/ShellCommandPrefixRecheck.cs:99-111 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:142-153 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs:97-108 — 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 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs: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.
Duplicated block (11–12 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:517— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:517-528 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5288-5298 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:517` 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. 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 (11–12 lines × 2) src/Kennel.Core/Accounts/Ui/Settings.razor:267— src/Kennel.Core/Accounts/Ui/Settings.razor:267-278 | src/Kennel.Core/Onboarding/Ui/Welcome.razor:111-121 — 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 (10–11 lines × 2) engine/src/CodeHealth.Toolchain/MsBuild/DotnetSdkProvisioner.cs:241— engine/src/CodeHealth.Toolchain/MsBuild/DotnetSdkProvisioner.cs:241-250 | engine/src/CodeHealth.Toolchain/MsBuild/SdkPinReconciler.cs:147-157 — 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 `engine/src/CodeHealth.Toolchain/MsBuild/DotnetSdkProvisioner.cs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Toolchain/MsBuild/DotnetSdkProvisioner.cs:240` calls `ThrowIfNull` and `engine/src/CodeHealth.Toolchain/MsBuild/SdkPinReconciler.cs:146` 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 (10–11 lines × 2) src/Kennel.Core/Portfolios/Ui/Portfolio.razor:232— src/Kennel.Core/Portfolios/Ui/Portfolio.razor:232-241 | src/Kennel.Core/Portfolios/Ui/Products.razor:268-278 — 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 `src/Kennel.Core/Portfolios/Ui/Portfolio.razor:232` 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 (9 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:909— engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:909-917 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:954-963 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:1020-1028 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:952` calls `foreach` and `engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:1018` 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 (9 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1157— engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1157-1165 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1218-1226 | engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1623-1631 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1157` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3533— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3533-3540 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3594-3601 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3651-3658 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3768-3775 — 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3533` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 4) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:547— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:547-554 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:316-323 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:437-444 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:475-482 — 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.
Duplicated block (6–8 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10673— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10673-10680 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10719-10724 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10673` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6–8 lines × 2) src/Kennel.Core/Inbox/Ui/Inbox.razor:25— src/Kennel.Core/Inbox/Ui/Inbox.razor:25-32 | src/Kennel.Core/Inbox/Ui/InboxArchived.razor:19-24 — 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 `src/Kennel.Core/Inbox/Ui/Inbox.razor: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 (7 lines × 3) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7234— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7234-7240 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7314-7320 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7422-7428 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7234` 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. 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 (7 lines × 3) engine/src/CodeHealth.Core/Docs/DocumentationConventions.cs:246— engine/src/CodeHealth.Core/Docs/DocumentationConventions.cs:246-252 | engine/src/CodeHealth.Core/FileQuality/ReleaseEvidence.cs:145-151 | engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3494-3500 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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 (6 lines × 5) engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:162— engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:162-167 | engine/src/CodeHealth.Dimensions.Docs/AdrQualityAnalyzer.cs:155-160 | engine/src/CodeHealth.Dimensions.Docs/CommentValueAnalyzer.cs:51-56 | engine/src/CodeHealth.Dimensions.Docs/DocumentationQualityAnalyzer.cs:36-41 | engine/src/CodeHealth.Dimensions.Docs/NamingConsistencyAnalyzer.cs:35-40 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. 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 (6 lines × 5) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:386— engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:386-397 | engine/src/CodeHealth.Dimensions.Security/Scanners/NamespaceScopedRuleAggregator.cs:269-280 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnappliableTerraformModuleScan.cs:196-207 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1413-1418 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10306-10311 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. 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 (6 lines × 4) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:391— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:391-396 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:520-525 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:530-535 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:702-707 — 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. 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 (6 lines × 4) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6270— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6270-6276 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6310-6316 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6783-6788 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7757-7762 — 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 `engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11 lines × 5) engine/src/CodeHealth.Core/CodeShape/PolyglotConditionScanner.cs:557— engine/src/CodeHealth.Core/CodeShape/PolyglotConditionScanner.cs:557-568 | engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:324-335 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:6422-6432 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4883-4894 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:240-251 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. 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 (11 lines × 5) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:3112— engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:3112-3122 | engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:608-618 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:581-591 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:594-604 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:793-803 — 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 5 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 (9 lines × 4) engine/src/CodeHealth.Core/Readiness/PipelineVersionOutputScan.cs:230— engine/src/CodeHealth.Core/Readiness/PipelineVersionOutputScan.cs:230-238 | engine/src/CodeHealth.Core/Scoring/CiGateDetection.cs:257-265 | engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigMapContentRuleFilter.cs:143-151 | engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs:1152-1160 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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 (9 lines × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableBaseImageScan.cs:213— engine/src/CodeHealth.Dimensions.Security/Scanners/MutableBaseImageScan.cs:213-221 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:367-375 | engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:407-415 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnpinnedToolchainInstallScan.cs:650-658 — 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.
R4 · Test Coverage· No test reaches this file · ×2
No test reaches this file tools/train/backlog-sessions/01a09ba7-5207-791d-a102-a79db2fa205c/fixture-slice.ts— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.mjs— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
AC3 · Page structure· Page without a main landmark · ×1
Page without a main landmark tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.html:2— No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
DependencyHygieneAnalyzer.RunAsync (cyclomatic 252) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:130— DependencyHygieneAnalyzer.RunAsync has cyclomatic complexity 252 (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.
dimension-routing.main (cyclomatic 171) tools/train/dimension-routing.py:431— dimension-routing.main has cyclomatic complexity 171 (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.
AnalyzeCommand.ExecuteCoreAsync (cyclomatic 144) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:171— AnalyzeCommand.ExecuteCoreAsync has cyclomatic complexity 144 (threshold 15). Of this number, 141 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
SupplyChainProvenanceAnalyzer.RunAsync (cyclomatic 135) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2625— SupplyChainProvenanceAnalyzer.RunAsync has cyclomatic complexity 135 (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.
CSharpCorrectnessAnalyzer.AnalyzeAsync (cyclomatic 130) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:27— CSharpCorrectnessAnalyzer.AnalyzeAsync has cyclomatic complexity 130 (threshold 15). Of this number, 125 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
ComplianceSecurityAnalyzer.S1 (cyclomatic 128) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5493— ComplianceSecurityAnalyzer.S1 has cyclomatic complexity 128 (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.
SecretsHistoryAnalyzer.GateCorpusAndDocumentedExampleFindings (cyclomatic 119) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:897— SecretsHistoryAnalyzer.GateCorpusAndDocumentedExampleFindings has cyclomatic complexity 119 (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.
ProductionReadinessAnalyzer.SecurityAndPerf (cyclomatic 114) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4675— ProductionReadinessAnalyzer.SecurityAndPerf has cyclomatic complexity 114 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
judge-routing.main (cyclomatic 107) tools/train/judge-routing.py:253— judge-routing.main has cyclomatic complexity 107 (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.
AccessibilityAnalyzer.AssessEnforcement (cyclomatic 105) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6348— AccessibilityAnalyzer.AssessEnforcement has cyclomatic complexity 105 (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.
JsDuplicationDetector.BuildDeclarationEntryMask (cyclomatic 102) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:860— JsDuplicationDetector.BuildDeclarationEntryMask has cyclomatic complexity 102 (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.
MaturityAnalyzer.FolderStructure (cyclomatic 97) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:881— MaturityAnalyzer.FolderStructure has cyclomatic complexity 97 (threshold 15). Of this number, 95 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
programme-status.main (cyclomatic 95) tools/train/programme-status.py:606— programme-status.main has cyclomatic complexity 95 (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.
SemgrepClaimRecheck.PremiseRefutedByTheCitedSource (cyclomatic 94) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs:293— SemgrepClaimRecheck.PremiseRefutedByTheCitedSource has cyclomatic complexity 94 (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.
AccessibilityAnalyzer.KeyboardSemantics (cyclomatic 84) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:3353— AccessibilityAnalyzer.KeyboardSemantics has cyclomatic complexity 84 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CoverageAnalyzer.RunAsync (cyclomatic 79) engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs:65— CoverageAnalyzer.RunAsync has cyclomatic complexity 79 (threshold 15). Of this number, 75 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
SolutionShapeAnalyzer.RunAsync (cyclomatic 78) engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:82— SolutionShapeAnalyzer.RunAsync has cyclomatic complexity 78 (threshold 15). Of this number, 69 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
judge_verification.main (cyclomatic 78) tools/train/judge_verification.py:419— judge_verification.main has cyclomatic complexity 78 (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.
IncompletenessAnalyzer.AnalyzeAsync (cyclomatic 76) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:146— IncompletenessAnalyzer.AnalyzeAsync has cyclomatic complexity 76 (threshold 15). Of this number, 75 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ProductionReadinessAnalyzer.ObservabilityAsync (cyclomatic 75) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4266— ProductionReadinessAnalyzer.ObservabilityAsync has cyclomatic complexity 75 (threshold 15). Of this number, 74 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceClassifier.EcosystemMarkerVerdict (cyclomatic 74) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3231— SourceClassifier.EcosystemMarkerVerdict has cyclomatic complexity 74 (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.
AppKindDetector.DetectAsync (cyclomatic 74) engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs:14— AppKindDetector.DetectAsync has cyclomatic complexity 74 (threshold 15). Of this number, 72 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
judge-k3-report.main (cyclomatic 74) tools/train/judge-k3-report.py:128— judge-k3-report.main has cyclomatic complexity 74 (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.
EventDrivenAnalyzer.OutboxDualWrite (cyclomatic 73) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1680— EventDrivenAnalyzer.OutboxDualWrite has cyclomatic complexity 73 (threshold 15). Of this number, 63 points are the body's own statements and 10 belong to 4 function literals inside it that branch. 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.
GodClassAnalyzer.RunAsync (cyclomatic 73) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:25— GodClassAnalyzer.RunAsync has cyclomatic complexity 73 (threshold 15). Of this number, 38 points are the body's own statements and 35 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ModuleSyntaxScanner.Scan (cyclomatic 71) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:284— ModuleSyntaxScanner.Scan has cyclomatic complexity 71 (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.
SupplyChainProvenanceAnalyzer.WorkflowTokenHygiene (cyclomatic 70) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8699— SupplyChainProvenanceAnalyzer.WorkflowTokenHygiene has cyclomatic complexity 70 (threshold 15). Of this number, 61 points are the body's own statements and 9 belong to 8 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DomainModelAnalyzer.AnemicDomainModel (cyclomatic 69) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2379— DomainModelAnalyzer.AnemicDomainModel has cyclomatic complexity 69 (threshold 15). Of this number, 37 points are the body's own statements and 32 belong to 12 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SecretNoiseFilter.IsGenericRuleNoise (cyclomatic 69) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:431— SecretNoiseFilter.IsGenericRuleNoise has cyclomatic complexity 69 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RoslynDuplicationDetector.ScanAsync (cyclomatic 67) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:524— RoslynDuplicationDetector.ScanAsync has cyclomatic complexity 67 (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.
RepoProfiler.DetectDdd (cyclomatic 66) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:308— RepoProfiler.DetectDdd has cyclomatic complexity 66 (threshold 15). Of this number, 53 points are the body's own statements and 13 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
HotspotAnalyzer.RunAsync (cyclomatic 66) engine/src/CodeHealth.Dimensions.GitMining/HotspotAnalyzer.cs:34— HotspotAnalyzer.RunAsync has cyclomatic complexity 66 (threshold 15). Of this number, 58 points are the body's own statements and 8 belong to 6 function literals inside it that branch. 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.
tokenize.tokenizeBody (cyclomatic 66) engine/sidecars/ruby-frontend/tokenize.mjs:15— tokenize.tokenizeBody has cyclomatic complexity 66 (threshold 15). Most of this is not in the body itself: 5 of the 66 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 42, 49, 57, …). 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.
dimension-coverage.main (cyclomatic 65) tools/multilang/dimension-coverage.py:321— dimension-coverage.main has cyclomatic complexity 65 (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.
ProductionReadinessAnalyzer.DisasterRecovery (cyclomatic 64) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:1889— ProductionReadinessAnalyzer.DisasterRecovery has cyclomatic complexity 64 (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.
agg_holdout5.main (cyclomatic 64) tools/multilang/agg_holdout5.py:78— agg_holdout5.main has cyclomatic complexity 64 (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.
AccessibilityAnalyzer.FormsAndLabels (cyclomatic 62) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2246— AccessibilityAnalyzer.FormsAndLabels has cyclomatic complexity 62 (threshold 15). Of this number, 58 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
FrontendBoundaries.CollectCrossPackageViolations (cyclomatic 61) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1055— FrontendBoundaries.CollectCrossPackageViolations has cyclomatic complexity 61 (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.
report_round.main (cyclomatic 61) tools/train/report_round.py:431— report_round.main has cyclomatic complexity 61 (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.
agg_combined.main (cyclomatic 60) tools/multilang/agg_combined.py:82— agg_combined.main has cyclomatic complexity 60 (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.
DartDeadLibraryField.StripNonCode (cyclomatic 59) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:136— DartDeadLibraryField.StripNonCode has cyclomatic complexity 59 (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.
FrontendTestReachability.Analyze (cyclomatic 59) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:81— FrontendTestReachability.Analyze has cyclomatic complexity 59 (threshold 15). Of this number, 57 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check.main (cyclomatic 59) engine/sidecars/kotlin-frontend/selftest/check.py:31— check.main has cyclomatic complexity 59 (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.
JsDuplicationDetector.TryMergeNearCloneSegment (cyclomatic 58) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4204— JsDuplicationDetector.TryMergeNearCloneSegment has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeSecretScanner.ScanLines (cyclomatic 58) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:782— NativeSecretScanner.ScanLines has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TestQualityAnalyzer.RunAsync (cyclomatic 58) engine/src/CodeHealth.Dimensions.Testing/TestQualityAnalyzer.cs:23— TestQualityAnalyzer.RunAsync has cyclomatic complexity 58 (threshold 15). Of this number, 51 points are the body's own statements and 7 belong to 6 function literals inside it that branch. 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.
agg_holdout6.main (cyclomatic 56) tools/multilang/agg_holdout6.py:94— agg_holdout6.main has cyclomatic complexity 56 (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.
check.main (cyclomatic 56) engine/sidecars/ruby-frontend/selftest/check.mjs:47— check.main has cyclomatic complexity 56 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
agg_holdout4.main (cyclomatic 55) tools/multilang/agg_holdout4.py:66— agg_holdout4.main has cyclomatic complexity 55 (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.
UpstreamAttribution.ForRepo (cyclomatic 54) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:148— UpstreamAttribution.ForRepo has cyclomatic complexity 54 (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.
AccessibilityAnalyzer.PageLevelChecks (cyclomatic 54) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2971— AccessibilityAnalyzer.PageLevelChecks has cyclomatic complexity 54 (threshold 15). Of this number, 42 points are the body's own statements and 12 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProductionReadinessAnalyzer.DeploymentRollback (cyclomatic 54) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:993— ProductionReadinessAnalyzer.DeploymentRollback has cyclomatic complexity 54 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ReportViewModelFactory.Build (cyclomatic 54) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:64— ReportViewModelFactory.Build has cyclomatic complexity 54 (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.
(anonymous) (cyclomatic 54) src/Kennel.Ui/wwwroot/kennel-ui.js:1927— (anonymous) has cyclomatic complexity 54 (threshold 15). Most of this is not in the body itself: 3 of the 54 points are its own statements and the rest belongs to 19 function items inside it that branch (patchBars::(anonymous), onLifecycle, connect, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
FrontendBundlerConfigRefs.CollectBundlerEntries (cyclomatic 53) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:848— FrontendBundlerConfigRefs.CollectBundlerEntries has cyclomatic complexity 53 (threshold 15). Of this number, 52 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendPathLiteralRefs.CollectPathLiteralRefs (cyclomatic 53) engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:11— FrontendPathLiteralRefs.CollectPathLiteralRefs has cyclomatic complexity 53 (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.
ChangeCouplingAnalyzer.HasExplicitDependency (cyclomatic 53) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3346— ChangeCouplingAnalyzer.HasExplicitDependency has cyclomatic complexity 53 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
check.main (cyclomatic 53) engine/sidecars/python-frontend/selftest/check.py:36— check.main has cyclomatic complexity 53 (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.
MemberFamilyRollup.Collapse (cyclomatic 52) engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:102— MemberFamilyRollup.Collapse has cyclomatic complexity 52 (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.
CouplingAnalyzer.RunAsync (cyclomatic 52) engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:27— CouplingAnalyzer.RunAsync has cyclomatic complexity 52 (threshold 15). Of this number, 40 points are the body's own statements and 12 belong to 7 function literals inside it that branch. 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.
TestReliabilityAnalyzer.RunAsync (cyclomatic 52) engine/src/CodeHealth.Dimensions.Testing/TestReliabilityAnalyzer.cs:60— TestReliabilityAnalyzer.RunAsync has cyclomatic complexity 52 (threshold 15). Of this number, 51 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
fallback-judge.cmd_score (cyclomatic 51) tools/train/fallback-judge.py:329— fallback-judge.cmd_score 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.
FrontendDeadCode.CountStandaloneReferences (cyclomatic 50) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1736— FrontendDeadCode.CountStandaloneReferences has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ProductionReadinessAnalyzer.ReleaseHygiene (cyclomatic 50) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2546— ProductionReadinessAnalyzer.ReleaseHygiene has cyclomatic complexity 50 (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.
FSharpSyntaxModel.build (cyclomatic 49) engine/src/CodeHealth.CodeModel.FSharp/SyntaxModel.fs:605— FSharpSyntaxModel.build has cyclomatic complexity 49 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
agg_combined4.main (cyclomatic 49) tools/multilang/agg_combined4.py:103— agg_combined4.main has cyclomatic complexity 49 (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.
agg_combined5.main (cyclomatic 49) tools/multilang/agg_combined5.py:108— agg_combined5.main has cyclomatic complexity 49 (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.
agg_combined6.main (cyclomatic 49) tools/multilang/agg_combined6.py:118— agg_combined6.main has cyclomatic complexity 49 (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.
ExplicitDebtAnalyzer.RunAsync (cyclomatic 48) engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:31— ExplicitDebtAnalyzer.RunAsync has cyclomatic complexity 48 (threshold 15). Of this number, 28 points are the body's own statements and 20 belong to 17 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
model-sweep.main (cyclomatic 48) tools/train/model-sweep.py:287— model-sweep.main has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SourceClassifier.ScanStringState (cyclomatic 47) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:1489— SourceClassifier.ScanStringState has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendDeadCode.FindUnusedExports (cyclomatic 47) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1254— FrontendDeadCode.FindUnusedExports has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncompletenessAnalyzer.Classify (cyclomatic 47) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:989— IncompletenessAnalyzer.Classify has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChangeCouplingAnalyzer.ImportedModulesOf (cyclomatic 47) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4851— ChangeCouplingAnalyzer.ImportedModulesOf has cyclomatic complexity 47 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Tokenizer.tokenize (cyclomatic 47) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Tokenizer.scala:65— Tokenizer.tokenize has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MaturityAnalyzer.ArchitectureDocs (cyclomatic 46) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:678— MaturityAnalyzer.ArchitectureDocs has cyclomatic complexity 46 (threshold 15). Of this number, 30 points are the body's own statements and 16 belong to 2 function literals inside it that branch. 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.
AccessibilityAnalyzer.TextAlternatives (cyclomatic 46) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:959— AccessibilityAnalyzer.TextAlternatives has cyclomatic complexity 46 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ScanParsers.DependencyDetail (cyclomatic 46) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2102— ScanParsers.DependencyDetail has cyclomatic complexity 46 (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.
agg_combined3.main (cyclomatic 46) tools/multilang/agg_combined3.py:89— agg_combined3.main has cyclomatic complexity 46 (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.
memberEmitters (cyclomatic 46) engine/sidecars/tsjs-frontend/extract-file.mjs:100— memberEmitters has cyclomatic complexity 46 (threshold 15). Most of this is not in the body itself: 1 of the 46 points is its own statement and the rest belongs to 11 function items inside it that branch (typeRefOfNode, emitAccessor, emitMember, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
EntryPointCatalog.DetectApplication (cyclomatic 45) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:269— EntryPointCatalog.DetectApplication has cyclomatic complexity 45 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
JsDuplicationDetector.BestEditedCopy (cyclomatic 45) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5457— JsDuplicationDetector.BestEditedCopy has cyclomatic complexity 45 (threshold 15). Of this number, 44 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RustTestCensus.Strip (cyclomatic 45) engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:196— RustTestCensus.Strip has cyclomatic complexity 45 (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.
Check.run (cyclomatic 45) engine/sidecars/elixir-frontend/selftest/check.exs:22— Check.run has cyclomatic complexity 45 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RoslynTestQualityCollector.AnalyzeRoot (cyclomatic 44) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:552— RoslynTestQualityCollector.AnalyzeRoot has cyclomatic complexity 44 (threshold 15). Of this number, 42 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TestDistributionAnalyzer.RunAsync (cyclomatic 44) engine/src/CodeHealth.Dimensions.Testing/TestDistributionAnalyzer.cs:21— TestDistributionAnalyzer.RunAsync 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.
MaturityAnalyzer.Documentation (cyclomatic 43) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:409— MaturityAnalyzer.Documentation has cyclomatic complexity 43 (threshold 15). Of this number, 39 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
KnowledgeConcentrationAnalyzer.RunAsync (cyclomatic 43) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:152— KnowledgeConcentrationAnalyzer.RunAsync has cyclomatic complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
Tokenizer.tokenize (cyclomatic 43) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Tokenizer.kt:24— Tokenizer.tokenize has cyclomatic complexity 43 (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.
ComplianceSecurityAnalyzer.AnalyzeAsync (cyclomatic 42) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:424— ComplianceSecurityAnalyzer.AnalyzeAsync has cyclomatic complexity 42 (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.
ComplianceSecurityAnalyzer.ScanSubstring (cyclomatic 42) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:796— ComplianceSecurityAnalyzer.ScanSubstring has cyclomatic complexity 42 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FrontendAnalyzer.Analyze (cyclomatic 42) engine/src/CodeHealth.Core/Discovery/FrontendAnalyzer.cs:196— FrontendAnalyzer.Analyze has cyclomatic complexity 42 (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.
AttributeConsumptionScanner.CollectAsync (cyclomatic 42) engine/src/CodeHealth.Core/ExplicitDebt/AttributeConsumptionScanner.cs:61— AttributeConsumptionScanner.CollectAsync has cyclomatic complexity 42 (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.
ArchitectureModelAnalyzer.SliceCohesion (cyclomatic 42) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2008— ArchitectureModelAnalyzer.SliceCohesion has cyclomatic complexity 42 (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.
RepoProfiler.DetectEventSourcing (cyclomatic 42) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:654— RepoProfiler.DetectEventSourcing has cyclomatic complexity 42 (threshold 15). Of this number, 38 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ProductionReadinessAnalyzer.Cicd (cyclomatic 42) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3435— ProductionReadinessAnalyzer.Cicd has cyclomatic complexity 42 (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. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
Tokenizer.tokenize (cyclomatic 42) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Tokenizer.java:31— Tokenizer.tokenize has cyclomatic complexity 42 (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.
judge-calibration.cmd_judge (cyclomatic 42) tools/train/judge-calibration.py:717— judge-calibration.cmd_judge has cyclomatic complexity 42 (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.
ComplianceSecurityAnalyzer.ScanCryptoStreamModeContradiction (cyclomatic 41) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2622— ComplianceSecurityAnalyzer.ScanCryptoStreamModeContradiction has cyclomatic complexity 41 (threshold 15). Of this number, 40 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OperabilityExtrasAnalyzer.AnalyzeAsync (cyclomatic 40) engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:21— OperabilityExtrasAnalyzer.AnalyzeAsync has cyclomatic complexity 40 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CloneSpanShape.Of (cyclomatic 40) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4123— CloneSpanShape.Of has cyclomatic complexity 40 (threshold 15). Of this number, 37 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChangeCouplingAnalyzer.BuildCoupledPairs (cyclomatic 40) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:736— ChangeCouplingAnalyzer.BuildCoupledPairs has cyclomatic complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendDependencyHygiene.CollectUnlisted (cyclomatic 39) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:2010— FrontendDependencyHygiene.CollectUnlisted 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.
JsScopeBindings.Build (cyclomatic 39) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:354— JsScopeBindings.Build 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.
ModuleSyntaxScanner.ScanExportDeclaration (cyclomatic 39) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:956— ModuleSyntaxScanner.ScanExportDeclaration 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.
DomainModelAnalyzer.MutableEntities (cyclomatic 39) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3324— DomainModelAnalyzer.MutableEntities has cyclomatic complexity 39 (threshold 15). Of this number, 28 points are the body's own statements and 11 belong to 2 function literals inside it that branch. 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.
NodeTestReliabilityCollector.CollectAsync (cyclomatic 39) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:143— NodeTestReliabilityCollector.CollectAsync has cyclomatic complexity 39 (threshold 15). Of this number, 35 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
ChangeCouplingAnalyzer.RunAsync (cyclomatic 39) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:66— ChangeCouplingAnalyzer.RunAsync has cyclomatic complexity 39 (threshold 15). Of this number, 30 points are the body's own statements and 9 belong to 9 function literals inside it that branch. 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.
KnowledgeFreshnessAnalyzer.RunAsync (cyclomatic 39) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeFreshnessAnalyzer.cs:81— KnowledgeFreshnessAnalyzer.RunAsync has cyclomatic complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IndentedMarkupProducer.TryParseTag (cyclomatic 38) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:366— IndentedMarkupProducer.TryParseTag 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.
MarkupParser.Build (cyclomatic 38) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:52— MarkupParser.Build 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.
MaturityAnalyzer.DeclaredWorkspaceMembers (cyclomatic 38) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:1475— MaturityAnalyzer.DeclaredWorkspaceMembers 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.
EventDrivenAnalyzer.OutboxDualWrite (cyclomatic 38) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:645— EventDrivenAnalyzer.OutboxDualWrite has cyclomatic complexity 38 (threshold 15). Of this number, 29 points are the body's own statements and 9 belong to 4 function literals inside it that branch. 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.
JvmSidecar.RunAsync (cyclomatic 38) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:385— JvmSidecar.RunAsync has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
callsOf (cyclomatic 38) engine/sidecars/tsjs-frontend/ts-helpers.mjs:506— callsOf has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 3 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (ownerFqnOf, declOf, record, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
collectModuleUnits (cyclomatic 38) engine/sidecars/tsjs-frontend/extract-file.mjs:11— collectModuleUnits has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 8 of the 38 points are its own statements and the rest belongs to 8 function items inside it that branch (insideTypeCarrier, unwrapCall, carriedByLogical, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AccessibilityAnalyzer.Analyze (cyclomatic 37) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:81— AccessibilityAnalyzer.Analyze has cyclomatic complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
AccessibilityAnalyzer.AriaCorrectness (cyclomatic 37) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4055— AccessibilityAnalyzer.AriaCorrectness has cyclomatic complexity 37 (threshold 15). Of this number, 32 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SecretNoiseFilter.IsNoisyPath (cyclomatic 37) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3867— SecretNoiseFilter.IsNoisyPath has cyclomatic complexity 37 (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.
SupplyChainProvenanceAnalyzer.SigningAdvice (cyclomatic 37) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3448— SupplyChainProvenanceAnalyzer.SigningAdvice has cyclomatic complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
bakeoff.run_model (cyclomatic 37) tools/llm-bakeoff/bakeoff.py:102— bakeoff.run_model has cyclomatic complexity 37 (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.
LineBasedGodClassDetector.DetectAsync (cyclomatic 36) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:34— LineBasedGodClassDetector.DetectAsync has cyclomatic complexity 36 (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.
ComplianceSecurityAnalyzer.ScanSyntax (cyclomatic 36) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1164— ComplianceSecurityAnalyzer.ScanSyntax has cyclomatic complexity 36 (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.
FrontendEngine.ModelGeneratedModules (cyclomatic 36) engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:142— FrontendEngine.ModelGeneratedModules has cyclomatic complexity 36 (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.
FrontendModuleGraph.Build (cyclomatic 36) engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:162— FrontendModuleGraph.Build has cyclomatic complexity 36 (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.
ArchitectureModelAnalyzer.SliceCohesion (cyclomatic 36) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:455— ArchitectureModelAnalyzer.SliceCohesion has cyclomatic complexity 36 (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.
DomainConventions.ClassifyHandler (cyclomatic 36) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1634— DomainConventions.ClassifyHandler has cyclomatic complexity 36 (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.
BodyFacts.node (cyclomatic 36) engine/sidecars/php-frontend/body.php:238— BodyFacts.node has cyclomatic complexity 36 (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.
extractFile (cyclomatic 36) engine/sidecars/tsjs-frontend/extract-file.mjs:427— extractFile has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 7 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (visitOrmCall, visit, visitTypeAlias, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
NeutralFileLengthScanner.CountBraces (cyclomatic 35) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:721— NeutralFileLengthScanner.CountBraces 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.
JsFunctionScanner.ScanMember (cyclomatic 35) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:429— JsFunctionScanner.ScanMember 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.
ModuleSyntaxScanner.ScanImportStatement (cyclomatic 35) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:668— ModuleSyntaxScanner.ScanImportStatement 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.
CSharpTokenizer.TokenizeLine (cyclomatic 35) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:80— CSharpTokenizer.TokenizeLine 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.
scope-evidence.evidence_for (cyclomatic 35) tools/train/scope-evidence.py:620— scope-evidence.evidence_for 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.
(anonymous) (cyclomatic 35) src/Kennel.Ui/wwwroot/kennel-ui.js:1600— (anonymous) has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 17 function items inside it that branch (wire::load, renderMd, wire, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ContainerDetector.HostKind (cyclomatic 34) engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:123— ContainerDetector.HostKind has cyclomatic complexity 34 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RustInlineTestModule.BlankLiteralsAndComments (cyclomatic 34) engine/src/CodeHealth.Core/Classification/RustInlineTestModule.cs:170— RustInlineTestModule.BlankLiteralsAndComments has cyclomatic complexity 34 (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.
ComplianceSecurityAnalyzer.ResolveConstantKeyRoot (cyclomatic 34) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3310— ComplianceSecurityAnalyzer.ResolveConstantKeyRoot has cyclomatic complexity 34 (threshold 15). Of this number, 33 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComplianceSecurityAnalyzer.C2 (cyclomatic 34) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5123— ComplianceSecurityAnalyzer.C2 has cyclomatic complexity 34 (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.
FrontendDependencyHygiene.CandidateBinNames (cyclomatic 34) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1541— FrontendDependencyHygiene.CandidateBinNames has cyclomatic complexity 34 (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.
FrontendTestSuiteMasking.CollectFromBenchmarkTree (cyclomatic 34) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:11— FrontendTestSuiteMasking.CollectFromBenchmarkTree has cyclomatic complexity 34 (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.
IndentedMarkupProducer.ParseAttributes (cyclomatic 34) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:586— IndentedMarkupProducer.ParseAttributes has cyclomatic complexity 34 (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.
DomainModelAnalyzer.RepositoryPerAggregateRoot (cyclomatic 34) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4981— DomainModelAnalyzer.RepositoryPerAggregateRoot has cyclomatic complexity 34 (threshold 15). Of this number, 31 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
ReportViewModelFactory.DeterministicBusinessBrief (cyclomatic 34) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:367— ReportViewModelFactory.DeterministicBusinessBrief has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DuplicationAnalyzer.GuardRegionOf (cyclomatic 34) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2994— DuplicationAnalyzer.GuardRegionOf has cyclomatic complexity 34 (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.
SupplyChainProvenanceAnalyzer.WorkflowGrantsWiderThanJobsUse (cyclomatic 34) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7913— SupplyChainProvenanceAnalyzer.WorkflowGrantsWiderThanJobsUse has cyclomatic complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ChangeCouplingAnalyzer.FactsFor (cyclomatic 34) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4453— ChangeCouplingAnalyzer.FactsFor has cyclomatic complexity 34 (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.
judge_assignment.census_failures (cyclomatic 34) tools/train/judge_assignment.py:1483— judge_assignment.census_failures has cyclomatic complexity 34 (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.
SourceClassifier.IsTestPath (cyclomatic 33) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:67— SourceClassifier.IsTestPath has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.BuildTopLevelBindingMask (cyclomatic 33) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:198— JsDuplicationDetector.BuildTopLevelBindingMask has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DomainModelAnalyzer.AggregateBoundaries (cyclomatic 33) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1930— DomainModelAnalyzer.AggregateBoundaries has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GdprPersonalDataAnalyzer.AnalyzeAsync (cyclomatic 33) engine/src/CodeHealth.Core/ModelAware/GdprPersonalDataAnalyzer.cs:70— GdprPersonalDataAnalyzer.AnalyzeAsync has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LogicDefectAnalyzer.AnalyzeAsync (cyclomatic 33) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:89— LogicDefectAnalyzer.AnalyzeAsync has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ArchGraphSvg.RenderClustered (cyclomatic 33) engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:124— ArchGraphSvg.RenderClustered has cyclomatic complexity 33 (threshold 15). Of this number, 30 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
JsSiblingScopeReadScan.IsRead (cyclomatic 33) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:324— JsSiblingScopeReadScan.IsRead has cyclomatic complexity 33 (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.
SupplyChainProvenanceAnalyzer.WorkflowSteps (cyclomatic 33) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6850— SupplyChainProvenanceAnalyzer.WorkflowSteps has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check.main (cyclomatic 33) engine/sidecars/scala-frontend/selftest/check.py:48— check.main has cyclomatic complexity 33 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
evidence-ab.main (cyclomatic 33) tools/train/evidence-ab.py:298— evidence-ab.main has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
gold-draw.cmd_verify (cyclomatic 33) tools/train/gold-draw.py:275— gold-draw.cmd_verify has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
branchWalker.stmt (cyclomatic 33) engine/sidecars/go/bodybranch.go:94— branchWalker.stmt has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CSharpSourceScanner.Tokenize (cyclomatic 32) engine/src/CodeHealth.Core/ApiSurface/CSharpSourceScanner.cs:33— CSharpSourceScanner.Tokenize has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArchitectureMapBuilder.BuildAsync (cyclomatic 32) engine/src/CodeHealth.Core/Architecture/ArchitectureMapBuilder.cs:43— ArchitectureMapBuilder.BuildAsync has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RoslynDeadCodeDetector.IsCandidate (cyclomatic 32) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:361— RoslynDeadCodeDetector.IsCandidate has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FrontendEngineDimensions.DeadCodeDimension (cyclomatic 32) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:622— FrontendEngineDimensions.DeadCodeDimension has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.DetectWholesaleFileCopies (cyclomatic 32) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5081— JsDuplicationDetector.DetectWholesaleFileCopies has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsScopeBindings.FunctionBodyParams (cyclomatic 32) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:505— JsScopeBindings.FunctionBodyParams has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AccessibilityAnalyzer.OrphanedLabels (cyclomatic 32) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2157— AccessibilityAnalyzer.OrphanedLabels has cyclomatic complexity 32 (threshold 15). Of this number, 27 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CodebaseSize.FromProjectsAsync (cyclomatic 32) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:131— CodebaseSize.FromProjectsAsync has cyclomatic complexity 32 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SecretsHistoryAnalyzer.CountBraceDelta (cyclomatic 32) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1537— SecretsHistoryAnalyzer.CountBraceDelta has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SupplyChainProvenanceAnalyzer.BuildIntegrityArms (cyclomatic 32) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2265— SupplyChainProvenanceAnalyzer.BuildIntegrityArms has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
render.render (cyclomatic 32) docs/marketing/whitepapers/render.py:117— render.render has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agg_scala_dm6.main (cyclomatic 32) tools/multilang/agg_scala_dm6.py:46— agg_scala_dm6.main has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EntryPointCatalog.DetectTests (cyclomatic 31) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:787— EntryPointCatalog.DetectTests has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendEngineDimensions.CloneRemediation (cyclomatic 31) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:1477— FrontendEngineDimensions.CloneRemediation has cyclomatic complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DomainConventions.ClassifyHandler (cyclomatic 31) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:287— DomainConventions.ClassifyHandler has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GoTestCensus.Strip (cyclomatic 31) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:232— GoTestCensus.Strip has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExplicitDebtAnalyzer.ToFinding (cyclomatic 31) engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:1039— ExplicitDebtAnalyzer.ToFinding has cyclomatic complexity 31 (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.
SupplyChainProvenanceAnalyzer.AdvisoryMonitoringFor (cyclomatic 31) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10185— SupplyChainProvenanceAnalyzer.AdvisoryMonitoringFor has cyclomatic complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RepoFindings.razor › HideRuleAsync (cyclomatic 31) src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:1267— RepoFindings.razor › HideRuleAsync has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
agg_go.main (cyclomatic 31) tools/multilang/agg_go.py:63— agg_go.main has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChainedCorrespondence.Aggregate (cyclomatic 30) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:79— ChainedCorrespondence.Aggregate has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendTestReachability.IsRegistrationDataModule (cyclomatic 30) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1492— FrontendTestReachability.IsRegistrationDataModule has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendTestReachability.ScanDataInitialiser (cyclomatic 30) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1716— FrontendTestReachability.ScanDataInitialiser has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.ExtendRunsThroughSupersetRelations (cyclomatic 30) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5923— JsDuplicationDetector.ExtendRunsThroughSupersetRelations has cyclomatic complexity 30 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ModuleSyntaxScanner.SelfDirectoryCompositionArg (cyclomatic 30) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1174— ModuleSyntaxScanner.SelfDirectoryCompositionArg has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EventDrivenAnalyzer.AnalyzeAsync (cyclomatic 30) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:72— EventDrivenAnalyzer.AnalyzeAsync has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
LogicDefectAnalyzer.InspectDisposalDuties (cyclomatic 30) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:1165— LogicDefectAnalyzer.InspectDisposalDuties has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RuleRecommendationEngine.ForDimension (cyclomatic 30) engine/src/CodeHealth.Reporting/Recommendations/RuleRecommendationEngine.cs:325— RuleRecommendationEngine.ForDimension has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileModel.ExpressionNeutralises (cyclomatic 30) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:892— FileModel.ExpressionNeutralises has cyclomatic complexity 30 (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.
SupplyChainProvenanceAnalyzer.SbomAdvice (cyclomatic 30) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3794— SupplyChainProvenanceAnalyzer.SbomAdvice has cyclomatic complexity 30 (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.
go_precision_adjudicate.adjudicate (cyclomatic 30) tools/multilang/go_precision_adjudicate.py:13— go_precision_adjudicate.adjudicate has cyclomatic complexity 30 (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.
programme-status.heldout_report (cyclomatic 30) tools/train/programme-status.py:454— programme-status.heldout_report has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileExtractor.classLike (cyclomatic 30) engine/sidecars/php-frontend/main.php:307— FileExtractor.classLike has cyclomatic complexity 30 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendBundlerConfigRefs.HandleFile (cyclomatic 29) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:11— FrontendBundlerConfigRefs.HandleFile has cyclomatic complexity 29 (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.
AccessibilityAnalyzer.PageStructureElement (cyclomatic 29) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:3254— AccessibilityAnalyzer.PageStructureElement has cyclomatic complexity 29 (threshold 15). Of this number, 20 points are the body's own statements and 9 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AccessibilityAnalyzer.CountIndentationTemplateTags (cyclomatic 29) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:313— AccessibilityAnalyzer.CountIndentationTemplateTags 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.
DomainModelAnalyzer.RepositoryPerAggregateRoot (cyclomatic 29) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1577— DomainModelAnalyzer.RepositoryPerAggregateRoot has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
GoDomainConventions.IsNeutralAggregate (cyclomatic 29) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:548— GoDomainConventions.IsNeutralAggregate has cyclomatic complexity 29 (threshold 15). Of this number, 22 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsInteropContractAnalyzer.AnalyzeAsync (cyclomatic 29) engine/src/CodeHealth.Core/ModelAware/JsInteropContractAnalyzer.cs:33— JsInteropContractAnalyzer.AnalyzeAsync 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.
SemverRange.Admits (cyclomatic 29) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:484— SemverRange.Admits has cyclomatic complexity 29 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SecretNoiseFilter.IsChecksumLiteralElementBinding (cyclomatic 29) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1133— SecretNoiseFilter.IsChecksumLiteralElementBinding has cyclomatic complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
KnowledgeDecayModel.Build (cyclomatic 29) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeDecayModel.cs:208— KnowledgeDecayModel.Build 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.
compare.main (cyclomatic 29) tools/multilang/compare.py:46— compare.main 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.
arm-state.main (cyclomatic 29) tools/train/arm-state.py:38— arm-state.main 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.
gold-draw.cmd_draw (cyclomatic 29) tools/train/gold-draw.py:179— gold-draw.cmd_draw 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.
rehearse_verification.main (cyclomatic 29) tools/train/rehearse_verification.py:314— rehearse_verification.main has cyclomatic complexity 29 (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.
body.tokenizeBody (cyclomatic 29) engine/sidecars/php-frontend/body.php:681— body.tokenizeBody 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.
ControlFlowComplexity.CognitiveShape (cyclomatic 28) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:274— ControlFlowComplexity.CognitiveShape has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
ComplianceSecurityAnalyzer.ScanCredentialExposure (cyclomatic 28) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1436— ComplianceSecurityAnalyzer.ScanCredentialExposure has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
PnpmLockfileReader.ReadDirectProduction (cyclomatic 28) engine/src/CodeHealth.Core/Dependencies/PnpmLockfileReader.cs:48— PnpmLockfileReader.ReadDirectProduction 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.
RoslynDeadCodeDetector.DetectAsync (cyclomatic 28) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:110— RoslynDeadCodeDetector.DetectAsync 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.
EntryPointCatalog.DetectFrameworkConventions (cyclomatic 28) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:540— EntryPointCatalog.DetectFrameworkConventions has cyclomatic complexity 28 (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.
FrontendTestReachability.PackageNameReached (cyclomatic 28) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:966— FrontendTestReachability.PackageNameReached 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.
DomainConventions.IsValueObject (cyclomatic 28) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1177— DomainConventions.IsValueObject has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
EventSourcingAnalyzer.PiiInEventStore (cyclomatic 28) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1128— EventSourcingAnalyzer.PiiInEventStore has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
CommittedCoverageReader.ParseSimpleCovJson (cyclomatic 28) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:726— CommittedCoverageReader.ParseSimpleCovJson 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.
ChangeSetBuilder.IsTestFile (cyclomatic 28) engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:843— ChangeSetBuilder.IsTestFile has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DuplicationAnalyzer.DuplicationRemediationCore (cyclomatic 28) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1546— DuplicationAnalyzer.DuplicationRemediationCore has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 5 function literals inside it that branch. 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.
SolutionShapeAnalyzer.BuildFindings (cyclomatic 28) engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:823— SolutionShapeAnalyzer.BuildFindings has cyclomatic complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
SemgrepShapeFilter.IsUnreachableClaim (cyclomatic 28) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepShapeFilter.cs:102— SemgrepShapeFilter.IsUnreachableClaim has cyclomatic complexity 28 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SupplyChainProvenanceAnalyzer.MovingCargoGitDependencies (cyclomatic 28) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1470— SupplyChainProvenanceAnalyzer.MovingCargoGitDependencies 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.
LineLexer.CodeOnly (cyclomatic 27) engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:235— LineLexer.CodeOnly 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.
JsDuplicationDetector.BuildImportMask (cyclomatic 27) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6932— JsDuplicationDetector.BuildImportMask 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.
JsScopeBindings.BindPattern (cyclomatic 27) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:801— JsScopeBindings.BindPattern 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.
SupplyChainHygieneAnalyzer.Detect (cyclomatic 27) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:56— SupplyChainHygieneAnalyzer.Detect 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.
CommitIdentityGraph.Build (cyclomatic 27) engine/src/CodeHealth.Toolchain/Git/CommitIdentityGraph.cs:62— CommitIdentityGraph.Build 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.
ChangelogNarrator.DescribeAsync (cyclomatic 27) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:201— ChangelogNarrator.DescribeAsync has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuplicationAnalyzer.ExtractionCaveat (cyclomatic 27) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3533— DuplicationAnalyzer.ExtractionCaveat 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.
CloneSpanShape.Scrub (cyclomatic 27) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4604— CloneSpanShape.Scrub 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.
ShellExecRecheck.RubyCallArguments (cyclomatic 27) engine/src/CodeHealth.Dimensions.Security/Scanners/ShellExecRecheck.cs:683— ShellExecRecheck.RubyCallArguments 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.
SupplyChainProvenanceAnalyzer.JobsScopedBelowTheirCheckout (cyclomatic 27) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8161— SupplyChainProvenanceAnalyzer.JobsScopedBelowTheirCheckout has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
baseline.main (cyclomatic 27) tools/multilang/baseline.py:241— baseline.main 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.
(anonymous) (cyclomatic 27) src/Kennel.Ui/wwwroot/kennel-ui.js:2073— (anonymous) has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 7 function items inside it that branch (dsmInit::(anonymous), dsmInit::highlight, dsmInit, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Lcom4Calculator.Analyze (cyclomatic 26) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:518— Lcom4Calculator.Analyze has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
FrontendConfigResolution.ParseTsConfigRaw (cyclomatic 26) engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:248— FrontendConfigResolution.ParseTsConfigRaw 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.
MinifiedJsHeuristics.StripStringsAndComments (cyclomatic 26) engine/src/CodeHealth.Core/Frontend/MinifiedJsHeuristics.cs:251— MinifiedJsHeuristics.StripStringsAndComments 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.
IndentedMarkupProducer.Read (cyclomatic 26) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:131— IndentedMarkupProducer.Read 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.
MarkupTaintPass.IsTainted (cyclomatic 26) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:181— MarkupTaintPass.IsTainted has cyclomatic complexity 26 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RunLimitations.BuildFailures (cyclomatic 26) engine/src/CodeHealth.Reporting/Limitations/RunLimitations.cs:104— RunLimitations.BuildFailures 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.
SupplyChainProvenanceAnalyzer.JobsGrantingWriteBeyondGatedSteps (cyclomatic 26) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7630— SupplyChainProvenanceAnalyzer.JobsGrantingWriteBeyondGatedSteps has cyclomatic complexity 26 (threshold 15). Of this number, 23 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
SupplyChainProvenanceAnalyzer.ActionArgvCommandLines (cyclomatic 26) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9606— SupplyChainProvenanceAnalyzer.ActionArgvCommandLines 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.
CodebaseDetail.razor › OnParametersSetAsync (cyclomatic 26) src/Kennel.Assay.Core/DecisionReports/Ui/CodebaseDetail.razor:209— CodebaseDetail.razor › OnParametersSetAsync 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.
BranchWalker._stmt (cyclomatic 26) engine/sidecars/python-frontend/bodyfacts.py:51— BranchWalker._stmt has cyclomatic complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
corpus_gitlab.discover (cyclomatic 26) tools/multilang/corpus_gitlab.py:89— corpus_gitlab.discover 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.
judge-viability-by-dimension.main (cyclomatic 26) tools/train/judge-viability-by-dimension.py:72— judge-viability-by-dimension.main 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.
BranchWalker.node (cyclomatic 26) engine/sidecars/php-frontend/body.php:55— BranchWalker.node 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.
ComplianceSecurityAnalyzer.ResolveConstantInt (cyclomatic 25) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3137— ComplianceSecurityAnalyzer.ResolveConstantInt has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ComplianceSecurityAnalyzer.C1 (cyclomatic 25) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5054— ComplianceSecurityAnalyzer.C1 has cyclomatic complexity 25 (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.
MixManifestHygiene.Read (cyclomatic 25) engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:68— MixManifestHygiene.Read 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.
RoslynExplicitDebtCollector.CollectObsoleteAsync (cyclomatic 25) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:4381— RoslynExplicitDebtCollector.CollectObsoleteAsync has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendEmittedTemplateRefs.ResolveEmittedTemplateFamilyAgainst (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:383— FrontendEmittedTemplateRefs.ResolveEmittedTemplateFamilyAgainst 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.
FrontendManifestEntryPoints.CollectMiniProgramEntryPaths (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:280— FrontendManifestEntryPoints.CollectMiniProgramEntryPaths 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.
FrontendModuleGraph.CircularGroups (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:624— FrontendModuleGraph.CircularGroups 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.
FrontendWorkspaceLoader.ReadSourceMapProvenance (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceLoader.BuildOutput.cs:139— FrontendWorkspaceLoader.ReadSourceMapProvenance 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.
JsComplexity.FindBracelessBodyEnd (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:497— JsComplexity.FindBracelessBodyEnd 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.
JsFunctionScanner.ScanExpressionBodyEnd (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:721— JsFunctionScanner.ScanExpressionBodyEnd 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. This is NOT this file's highest cyclomatic complexity: JsFunctionScanner.ClassifyOpenBrace (cyclomatic 30) 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.
Scanner.ScanNumber (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:298— Scanner.ScanNumber has cyclomatic complexity 25 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ModuleResolver.ModuleResolver.ctor (cyclomatic 25) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:106— ModuleResolver.ModuleResolver.ctor has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
ArchitectureStyleDetector.DetectAsync (cyclomatic 25) engine/src/CodeHealth.Core/ModelAware/ArchitectureStyleDetector.cs:99— ArchitectureStyleDetector.DetectAsync has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EventSourcingAnalyzer.PiiInEventStore (cyclomatic 25) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:421— EventSourcingAnalyzer.PiiInEventStore has cyclomatic complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommittedCoverageReader.EnumerateCandidates (cyclomatic 25) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:211— CommittedCoverageReader.EnumerateCandidates has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsTestCensus.Strip (cyclomatic 25) engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:163— JsTestCensus.Strip 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.
ComposeServiceSurface.ServicesIn (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:114— ComposeServiceSurface.ServicesIn 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.
GoModuleContextRechecks.AssertedMapKeyIsLocalCompositeLiteral (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/Scanners/GoModuleContextRechecks.cs:275— GoModuleContextRechecks.AssertedMapKeyIsLocalCompositeLiteral 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.
ScanParsers.SiblingAdvisoryFloors (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1197— ScanParsers.SiblingAdvisoryFloors has cyclomatic complexity 25 (threshold 15). Of this number, 21 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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.
ScanParsers.OsvFindings (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1417— ScanParsers.OsvFindings 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.
FileModel.IndexMethods (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:632— FileModel.IndexMethods 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.
SupplyChainProvenanceAnalyzer.TokenAuthedNpmPublishes (cyclomatic 25) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.NpmRegistryAuth.cs:176— SupplyChainProvenanceAnalyzer.TokenAuthedNpmPublishes has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BodyEmit.forBody (cyclomatic 25) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/BodyEmit.scala:37— BodyEmit.forBody has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
status.main (cyclomatic 25) tools/llm-bakeoff/status.py:66— status.main 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.
draw.main (cyclomatic 25) tools/rescan/draw.py:165— draw.main 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.
ts-helpers.branchesOf (cyclomatic 25) engine/sidecars/tsjs-frontend/ts-helpers.mjs:345— ts-helpers.branchesOf has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 10 of the 25 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 369, 349, 386, …). 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.
(anonymous) (cyclomatic 25) src/Kennel.Ui/wwwroot/kennel-ui.js:1810— (anonymous) has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 17 function items inside it that branch (wire::render, wire, wire::render::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
IndirectionAnalyzer.AnalyzeAsync (cyclomatic 24) engine/src/CodeHealth.Core/Architecture/IndirectionAnalyzer.cs:140— IndirectionAnalyzer.AnalyzeAsync 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.
PolyglotConditionScanner.BlankNonCode (cyclomatic 24) engine/src/CodeHealth.Core/CodeShape/PolyglotConditionScanner.cs:322— PolyglotConditionScanner.BlankNonCode 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.
Lcom4Calculator.ComputeAsync (cyclomatic 24) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:26— Lcom4Calculator.ComputeAsync 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.
BundlerManifestHygiene.Read (cyclomatic 24) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:90— BundlerManifestHygiene.Read 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.
NpmManifestHygiene.FloatingReason (cyclomatic 24) engine/src/CodeHealth.Core/Dependencies/NpmManifestHygiene.cs:314— NpmManifestHygiene.FloatingReason has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
FrontendAnalyzer.Score (cyclomatic 24) engine/src/CodeHealth.Core/Discovery/FrontendAnalyzer.cs:526— FrontendAnalyzer.Score has cyclomatic complexity 24 (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.
FrontendDependencyHygiene.IsDependencyUsed (cyclomatic 24) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:722— FrontendDependencyHygiene.IsDependencyUsed has cyclomatic complexity 24 (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.
JsDuplicationDetector.Detect (cyclomatic 24) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2405— JsDuplicationDetector.Detect 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.
JsDuplicationDetector.MarkCommonJsWiring (cyclomatic 24) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:7093— JsDuplicationDetector.MarkCommonJsWiring 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.
JsRedundantReDefault.IsRedundantAt (cyclomatic 24) engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs:67— JsRedundantReDefault.IsRedundantAt 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.
ModuleSyntaxScanner.CollectCommentTypeImports (cyclomatic 24) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:163— ModuleSyntaxScanner.CollectCommentTypeImports has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
EventDrivenAnalyzer.EventCommandShape (cyclomatic 24) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1583— EventDrivenAnalyzer.EventCommandShape has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
MarkupTaintPass.CollectHoles (cyclomatic 24) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:681— MarkupTaintPass.CollectHoles 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.
ScalaDomainConventions.Dm6InfraLeak (cyclomatic 24) engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:233— ScalaDomainConventions.Dm6InfraLeak 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.
SupplyChainHygieneAnalyzer.BuildCard (cyclomatic 24) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:447— SupplyChainHygieneAnalyzer.BuildCard 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.
CiWorkflowReader.IsPipelinePath (cyclomatic 24) engine/src/CodeHealth.Core/Readiness/CiWorkflowReader.cs:240— CiWorkflowReader.IsPipelinePath has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ProductionReadinessAnalyzer.CiGateHonesty (cyclomatic 24) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:108— ProductionReadinessAnalyzer.CiGateHonesty has cyclomatic complexity 24 (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: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
DiskSourceFiles.WeighUnreadLanguagesAsync (cyclomatic 24) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:861— DiskSourceFiles.WeighUnreadLanguagesAsync 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. This is NOT this file's highest cyclomatic complexity: DiskSourceFiles.IsNeverProductionSourceFile (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 method is counted neither in this dimension's figures nor in its score.
CommittedCoverageReader.ParseJsonCoverage (cyclomatic 24) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:591— CommittedCoverageReader.ParseJsonCoverage has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
GitDiffShapes.ParseAsync (cyclomatic 24) engine/src/CodeHealth.Toolchain/Git/GitDiffShapes.cs:225— GitDiffShapes.ParseAsync 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.
MutableGitCloneScan.Offence (cyclomatic 24) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:161— MutableGitCloneScan.Offence 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.
RubyArgumentMutatedScan.ParametersOf (cyclomatic 24) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:264— RubyArgumentMutatedScan.ParametersOf 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.
UnverifiedRemoteInstallerScan.ExtractedAndExecuted (cyclomatic 24) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:756— UnverifiedRemoteInstallerScan.ExtractedAndExecuted has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WorkflowInputGateRecheck.ExpressionYieldsOnlyShellSafeText (cyclomatic 24) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:105— WorkflowInputGateRecheck.ExpressionYieldsOnlyShellSafeText 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.
StaticAnalysisAnalyzer.RunAsync (cyclomatic 24) engine/src/CodeHealth.Dimensions.Security/StaticAnalysisAnalyzer.cs:85— StaticAnalysisAnalyzer.RunAsync has cyclomatic complexity 24 (threshold 15). Of this number, 15 points are the body's own statements and 9 belong to 6 function literals inside it that branch. 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.
RepoFindings.razor › get (cyclomatic 24) src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:1077— RepoFindings.razor › get has cyclomatic complexity 24 (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.
FSharpProvider.CreateMany (cyclomatic 24) engine/src/CodeHealth.CodeModel.FSharp/FSharpProvider.fs:174— FSharpProvider.CreateMany has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
gold-draw.cmd_coverage (cyclomatic 24) tools/train/gold-draw.py:113— gold-draw.cmd_coverage 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.
judge-calibration.cmd_extract (cyclomatic 24) tools/train/judge-calibration.py:413— judge-calibration.cmd_extract 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.
report_detection_delta.validate (cyclomatic 24) tools/train/report_detection_delta.py:294— report_detection_delta.validate 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.
branchWalker.stmtOpaque (cyclomatic 24) engine/sidecars/go/bodybranch.go:311— branchWalker.stmtOpaque has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Extractor.collectMember (cyclomatic 24) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Extractor.swift:145— Extractor.collectMember 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.
typeEmitters (cyclomatic 24) engine/sidecars/tsjs-frontend/extract-file.mjs:338— typeEmitters has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function items inside it that branch (heritageOf, classOrmOf, visitClass, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MemberPairRollup.Aggregate (cyclomatic 23) engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:74— MemberPairRollup.Aggregate 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.
QuotedTextMask.Mask (cyclomatic 23) engine/src/CodeHealth.Core/CodeShape/QuotedTextMask.cs:144— QuotedTextMask.Mask 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.
RoslynDuplicationDetector.AppendCopiedFileClones (cyclomatic 23) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1324— RoslynDuplicationDetector.AppendCopiedFileClones has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Subsumption.Implies (cyclomatic 23) engine/src/CodeHealth.Core/CodeShape/Subsumption.cs:46— Subsumption.Implies 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.
ComplianceSecurityAnalyzer.ResolveDeclaredTypeName (cyclomatic 23) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1964— ComplianceSecurityAnalyzer.ResolveDeclaredTypeName has cyclomatic complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
ComplianceSecurityAnalyzer.ScanStaticEncryptionIv (cyclomatic 23) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2181— ComplianceSecurityAnalyzer.ScanStaticEncryptionIv has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DartDeadLibraryField.IsFieldDeclaration (cyclomatic 23) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:601— DartDeadLibraryField.IsFieldDeclaration 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.
RoslynExplicitDebtCollector.CollectInvertedNullGuards (cyclomatic 23) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:868— RoslynExplicitDebtCollector.CollectInvertedNullGuards 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.
FrontendBoundaries.CollectThirdPartyBuildOutputImports (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1786— FrontendBoundaries.CollectThirdPartyBuildOutputImports 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.
FrontendEmittedTemplateRefs.CollectGeneratedModuleEmitters (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:124— FrontendEmittedTemplateRefs.CollectGeneratedModuleEmitters has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
FrontendTestAndDocRefs.AddImportMapKeys (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:512— FrontendTestAndDocRefs.AddImportMapKeys 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.
JsDuplicationDetector.TryHashWindow (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2861— JsDuplicationDetector.TryHashWindow has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsFunctionScanner.IsClassHeaderClose (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:175— JsFunctionScanner.IsClassHeaderClose 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. This is NOT this file's highest cyclomatic complexity: JsFunctionScanner.ClassifyOpenBrace (cyclomatic 30) 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.
Scanner.ScanOnce (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:119— Scanner.ScanOnce has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsScopeBindings.BindDeclarators (cyclomatic 23) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:668— JsScopeBindings.BindDeclarators 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.
CoherenceSmellAnalyzer.Implies (cyclomatic 23) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:335— CoherenceSmellAnalyzer.Implies 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.
DataShapeSmellAnalyzer.AnalyzeAsync (cyclomatic 23) engine/src/CodeHealth.Core/ModelAware/DataShapeSmellAnalyzer.cs:29— DataShapeSmellAnalyzer.AnalyzeAsync has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DomainModelAnalyzer.StronglyTypedIds (cyclomatic 23) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2156— DomainModelAnalyzer.StronglyTypedIds has cyclomatic complexity 23 (threshold 15). Of this number, 15 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DomainComplexityClassifier.Classify (cyclomatic 23) engine/src/CodeHealth.Core/Scoring/DomainComplexity.cs:20— DomainComplexityClassifier.Classify has cyclomatic complexity 23 (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.
CommittedCoverageReader.MergeXmlPerFile (cyclomatic 23) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:957— CommittedCoverageReader.MergeXmlPerFile has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommittedCoverageReader.MergeIstanbulJsonPerFile (cyclomatic 23) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1179— CommittedCoverageReader.MergeIstanbulJsonPerFile 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.
DotnetTestReliabilityCollector.CollectAsync (cyclomatic 23) engine/src/CodeHealth.Core/Testing/DotnetTestReliabilityCollector.cs:30— DotnetTestReliabilityCollector.CollectAsync has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NodeTestSuiteProbe.ChooseRunner (cyclomatic 23) engine/src/CodeHealth.Core/Testing/NodeTestSuiteProbe.cs:466— NodeTestSuiteProbe.ChooseRunner has cyclomatic complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
RoslynTestQualityCollector.CollectAsync (cyclomatic 23) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:153— RoslynTestQualityCollector.CollectAsync 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.
ReportViewModelFactory.BuildArchGraphCore (cyclomatic 23) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:2506— ReportViewModelFactory.BuildArchGraphCore 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.
DuplicationAnalyzer.DivergentTypeBindingCaveat (cyclomatic 23) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1800— DuplicationAnalyzer.DivergentTypeBindingCaveat 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.
ConfigCredentialBindingScan.FindingsInFile (cyclomatic 23) engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:275— ConfigCredentialBindingScan.FindingsInFile 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.
CSharpTokenizer.ReadStringLiteral (cyclomatic 23) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:238— CSharpTokenizer.ReadStringLiteral 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.
XmlBuildOnlyRecheck.XmlUseIsBuildOnly (cyclomatic 23) engine/src/CodeHealth.Dimensions.Security/Scanners/XmlBuildOnlyRecheck.cs:62— XmlBuildOnlyRecheck.XmlUseIsBuildOnly 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.
SupplyChainProvenanceAnalyzer.ReleaseAssetUploadJobsText (cyclomatic 23) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5516— SupplyChainProvenanceAnalyzer.ReleaseAssetUploadJobsText 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.
SupplyChainProvenanceAnalyzer.PushTriggerFilters (cyclomatic 23) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7233— SupplyChainProvenanceAnalyzer.PushTriggerFilters 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.
ChangeCouplingAnalyzer.RustVariantsOf (cyclomatic 23) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4142— ChangeCouplingAnalyzer.RustVariantsOf 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.
KnowledgeDecayModel.LastSubstantiveAuthorStillActive (cyclomatic 23) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeDecayModel.cs:524— KnowledgeDecayModel.LastSubstantiveAuthorStillActive has cyclomatic complexity 23 (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.
verify-documentation-paths.main (cyclomatic 23) deploy/verify-documentation-paths.py:269— verify-documentation-paths.main 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.
build_gitlab_manifest.main (cyclomatic 23) tools/multilang/build_gitlab_manifest.py:42— build_gitlab_manifest.main 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.
backlog-drop-unreachable.main (cyclomatic 23) tools/ops/backlog-drop-unreachable.py:118— backlog-drop-unreachable.main 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.
bench.main (cyclomatic 23) tools/qwen-eval/bench.py:326— bench.main 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.
prove-gap-channel-separation.main (cyclomatic 23) tools/train/prove-gap-channel-separation.py:42— prove-gap-channel-separation.main 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.
report_round.build_rows (cyclomatic 23) tools/train/report_round.py:143— report_round.build_rows has cyclomatic complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
scope-evidence.value_provenance_evidence (cyclomatic 23) tools/train/scope-evidence.py:427— scope-evidence.value_provenance_evidence 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.
sidecarlib.arm_status (cyclomatic 23) tools/train/sidecarlib.py:150— sidecarlib.arm_status has cyclomatic complexity 23 (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.
SourceClassifier.CountCatalogueLines (cyclomatic 22) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:1336— SourceClassifier.CountCatalogueLines 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.
ComplianceSecurityAnalyzer.KeyMaterialArgument (cyclomatic 22) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3231— ComplianceSecurityAnalyzer.KeyMaterialArgument has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SwiftPackageHygiene.Read (cyclomatic 22) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:81— SwiftPackageHygiene.Read 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.
FrontendEmittedTemplateRefs.CollectBundleEntries (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:230— FrontendEmittedTemplateRefs.CollectBundleEntries 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.
FrontendEmittedTemplateRefs.ResolveEmittedTemplateDirectory (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:480— FrontendEmittedTemplateRefs.ResolveEmittedTemplateDirectory 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.
FrontendTestReachability.IsBehaviourFreeDataModule (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1320— FrontendTestReachability.IsBehaviourFreeDataModule has cyclomatic complexity 22 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsComplexity.ComputeCognitive (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:260— JsComplexity.ComputeCognitive 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.
JsDuplicationDetector.DetectEditedCopies (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4902— JsDuplicationDetector.DetectEditedCopies 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.
JsFunctionScanner.SkipTypeParameters (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:949— JsFunctionScanner.SkipTypeParameters 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. This is NOT this file's highest cyclomatic complexity: JsFunctionScanner.ClassifyOpenBrace (cyclomatic 30) 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.
Scanner.SkipTrivia (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:194— Scanner.SkipTrivia 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.
ModuleSyntaxScanner.ScanCommentTypeImports (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:78— ModuleSyntaxScanner.ScanCommentTypeImports 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.
ModuleSyntaxScanner.DestructuredAwaitSymbols (cyclomatic 22) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:590— ModuleSyntaxScanner.DestructuredAwaitSymbols 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.
DomainModelAnalyzer.AnalyzeAsync (cyclomatic 22) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:84— DomainModelAnalyzer.AnalyzeAsync 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.
DomainModelAnalyzer.IntegrationEventCoupling (cyclomatic 22) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2266— DomainModelAnalyzer.IntegrationEventCoupling has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
DomainModelAnalyzer.AddGoDomainInfraLeaks (cyclomatic 22) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4758— DomainModelAnalyzer.AddGoDomainInfraLeaks has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
LogicDefectAnalyzer.InspectDroppedDisposalDuty (cyclomatic 22) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:1644— LogicDefectAnalyzer.InspectDroppedDisposalDuty has cyclomatic complexity 22 (threshold 15). Of this number, 12 points are the body's own statements and 10 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
PerformanceAnalyzer.CollectAsync (cyclomatic 22) engine/src/CodeHealth.Core/ModelAware/PerformanceAnalyzer.cs:311— PerformanceAnalyzer.CollectAsync 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.
DiskTestScanner.UnreadableTestSources (cyclomatic 22) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:232— DiskTestScanner.UnreadableTestSources 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.
ChangelogNarrator.SemanticDedupeAsync (cyclomatic 22) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:447— ChangelogNarrator.SemanticDedupeAsync 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.
RuleRecommendationEngine.ForMeta (cyclomatic 22) engine/src/CodeHealth.Reporting/Recommendations/RuleRecommendationEngine.cs:158— RuleRecommendationEngine.ForMeta 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.
InternalApiConsistencyAnalyzer.RunAsync (cyclomatic 22) engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:24— InternalApiConsistencyAnalyzer.RunAsync has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuplicationAnalyzer.RunAsync (cyclomatic 22) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:25— DuplicationAnalyzer.RunAsync has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
SecretsHistoryAnalyzer.GateRenamedIntoTestTreeFindingsAsync (cyclomatic 22) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:2127— SecretsHistoryAnalyzer.GateRenamedIntoTestTreeFindingsAsync 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.
SupplyChainProvenanceAnalyzer.PrTriggeredWorkflowsGrantingWrite (cyclomatic 22) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7795— SupplyChainProvenanceAnalyzer.PrTriggeredWorkflowsGrantingWrite has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
JvmProvider.Build (cyclomatic 22) engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:450— JvmProvider.Build has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Emitter.emitType (cyclomatic 22) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Emitter.scala:66— Emitter.emitType has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build_dimension_noise.main (cyclomatic 22) tools/depthnoise/build_dimension_noise.py:308— build_dimension_noise.main 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.
bakeoff.score_run (cyclomatic 22) tools/llm-bakeoff/bakeoff.py:204— bakeoff.score_run 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.
bench.run_agent (cyclomatic 22) tools/qwen-eval/bench.py:142— bench.run_agent 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.
analyse.main (cyclomatic 22) tools/rescan/analyse.py:65— analyse.main has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BranchWalker.walk (cyclomatic 22) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Body.swift:195— BranchWalker.walk has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChainedFamilyRollup.Append (cyclomatic 21) engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:93— ChainedFamilyRollup.Append has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
QuotedTextMask.MaskStringLiteral (cyclomatic 21) engine/src/CodeHealth.Core/CodeShape/QuotedTextMask.cs:208— QuotedTextMask.MaskStringLiteral 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.
RoslynDuplicationDetector.AppendMultiplicitySites (cyclomatic 21) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1744— RoslynDuplicationDetector.AppendMultiplicitySites 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.
CyclomaticComplexityCalculator.ComputeAsync (cyclomatic 21) engine/src/CodeHealth.Core/Complexity/CyclomaticComplexityCalculator.cs:32— CyclomaticComplexityCalculator.ComputeAsync 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.
BundlerManifestHygiene.ParseDeclarations (cyclomatic 21) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:623— BundlerManifestHygiene.ParseDeclarations 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.
EggMiddlewareNameRefs.StripComments (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/EggMiddlewareNameRefs.cs:129— EggMiddlewareNameRefs.StripComments has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
EntryPointCatalog.DetectTooling (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:984— EntryPointCatalog.DetectTooling has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
FrontendScriptCommandRefs.CollectToolCommandTokens (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:424— FrontendScriptCommandRefs.CollectToolCommandTokens has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsConstantOnlyField.IsExported (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:364— JsConstantOnlyField.IsExported 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.
JsDuplicationDetector.MergeNearCloneExtents (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4099— JsDuplicationDetector.MergeNearCloneExtents has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.IsTypeMemberList (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:7640— JsDuplicationDetector.IsTypeMemberList has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
JsFunctionScanner.NameBeforeTypeAnnotation (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:1109— JsFunctionScanner.NameBeforeTypeAnnotation 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. This is NOT this file's highest cyclomatic complexity: JsFunctionScanner.ClassifyOpenBrace (cyclomatic 30) 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.
ModuleResolver.Resolve (cyclomatic 21) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:284— ModuleResolver.Resolve 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.
IndentedMarkupProducer.ReadValue (cyclomatic 21) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:697— IndentedMarkupProducer.ReadValue 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.
DomainConventions.IsDomainEvent (cyclomatic 21) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1040— DomainConventions.IsDomainEvent 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.
EventDrivenAnalyzer.SyncInHandler (cyclomatic 21) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1285— EventDrivenAnalyzer.SyncInHandler 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.
IncompletenessAnalyzer.IsTrivialValue (cyclomatic 21) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3149— IncompletenessAnalyzer.IsTrivialValue has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LogicDefectAnalyzer.EmptinessClaim (cyclomatic 21) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:4437— LogicDefectAnalyzer.EmptinessClaim has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
OperabilityExtrasAnalyzer.LibraryPublicApiAsync (cyclomatic 21) engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:235— OperabilityExtrasAnalyzer.LibraryPublicApiAsync 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.
CiGateDetection.SoftFailedAt (cyclomatic 21) engine/src/CodeHealth.Core/Scoring/CiGateDetection.cs:166— CiGateDetection.SoftFailedAt 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.
CommittedCoverageReader.ParseXml (cyclomatic 21) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:433— CommittedCoverageReader.ParseXml 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.
CommittedCoverageReader.MergeSimpleCovJsonPerFile (cyclomatic 21) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1299— CommittedCoverageReader.MergeSimpleCovJsonPerFile 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.
ArchGraphSvg.Render (cyclomatic 21) engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:19— ArchGraphSvg.Render has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DeclaredDependencies.FromManifests (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:838— DeclaredDependencies.FromManifests 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.
DeclaredDependencies.Classify (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1314— DeclaredDependencies.Classify has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JsSiblingScopeReadScan.ParameterListSpans (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:565— JsSiblingScopeReadScan.ParameterListSpans 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.
OsvScannerIgnores.Parse (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/Scanners/OsvScannerIgnores.cs:244— OsvScannerIgnores.Parse 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.
FileModel.SpanCoversTheRawAppend (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:1352— FileModel.SpanCoversTheRawAppend has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SupplyChainProvenanceAnalyzer.MovingPythonGitDependencies (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1820— SupplyChainProvenanceAnalyzer.MovingPythonGitDependencies 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.
SupplyChainProvenanceAnalyzer.NpmWorkspacePatterns (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:4107— SupplyChainProvenanceAnalyzer.NpmWorkspacePatterns 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.
SupplyChainProvenanceAnalyzer.UninvokedRegistryPublishPath (cyclomatic 21) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PublishTrigger.cs:96— SupplyChainProvenanceAnalyzer.UninvokedRegistryPublishPath has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ChangeCouplingAnalyzer.JsTsImportsSibling (cyclomatic 21) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5147— ChangeCouplingAnalyzer.JsTsImportsSibling has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FSharpBody.walk (cyclomatic 21) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:116— FSharpBody.walk has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
FSharpBody.flatTokens (cyclomatic 21) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:420— FSharpBody.flatTokens 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.
ModelBuilder.WrapEntity (cyclomatic 21) engine/src/CodeHealth.CodeModel.FSharp/Builder.fs:214— ModelBuilder.WrapEntity 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.
Branches.walk (cyclomatic 21) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Branches.java:96— Branches.walk has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Main.main (cyclomatic 21) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Main.java:32— Main.main has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
quality.main (cyclomatic 21) tools/llm-bakeoff/quality.py:63— quality.main 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.
lint_hardcode.main (cyclomatic 21) tools/multilang/lint_hardcode.py:31— lint_hardcode.main 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.
scan.run_contained (cyclomatic 21) tools/multilang/scan.py:361— scan.run_contained 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.
gold-record.main (cyclomatic 21) tools/train/gold-record.py:37— gold-record.main 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.
judge-with-tools.run_tool (cyclomatic 21) tools/train/judge-with-tools.py:77— judge-with-tools.run_tool 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.
report_round.measure_dimensions (cyclomatic 21) tools/train/report_round.py:294— report_round.measure_dimensions 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.
main.scanBodyText (cyclomatic 21) engine/sidecars/go/bodylines.go:557— main.scanBodyText 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.
(anonymous) (cyclomatic 21) src/Kennel.Ui/wwwroot/kennel-ui.js:1701— (anonymous) has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (apply, initScansFilter, wire, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SourceClassifier.IsDemoPrefixedSampleProject (cyclomatic 20) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3023— SourceClassifier.IsDemoPrefixedSampleProject 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.
SourceClassifier.PackageJsonVerdict (cyclomatic 20) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3473— SourceClassifier.PackageJsonVerdict has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LineBasedGodClassDetector.MeasureLeg (cyclomatic 20) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:1362— LineBasedGodClassDetector.MeasureLeg has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VbGodClassScanner.ScanAsync (cyclomatic 20) engine/src/CodeHealth.Core/CodeShape/VbGodClassScanner.cs:19— VbGodClassScanner.ScanAsync 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.
Lcom4Calculator.AnalyzeVb (cyclomatic 20) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:343— Lcom4Calculator.AnalyzeVb 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.
ComplianceSecurityAnalyzer.ScanUnauthenticatedCipherMode (cyclomatic 20) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2418— ComplianceSecurityAnalyzer.ScanUnauthenticatedCipherMode has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendMetaDimensions.ImportBoundariesFix (cyclomatic 20) engine/src/CodeHealth.Core/Discovery/FrontendMetaDimensions.cs:199— FrontendMetaDimensions.ImportBoundariesFix has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RoslynExplicitDebtCollector.ReadSeverityAssignments (cyclomatic 20) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:6279— RoslynExplicitDebtCollector.ReadSeverityAssignments 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.
AmbientDeclarationFile.IsAmbientDeclarationFile (cyclomatic 20) engine/src/CodeHealth.Core/Frontend/AmbientDeclarationFile.cs:34— AmbientDeclarationFile.IsAmbientDeclarationFile 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.
FrontendBoundaries.CollectTestTreeCrossPackageViolations (cyclomatic 20) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1401— FrontendBoundaries.CollectTestTreeCrossPackageViolations 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.
FrontendTestReachability.DirectoryBarrelReached (cyclomatic 20) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:2132— FrontendTestReachability.DirectoryBarrelReached 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.
JsDuplicationDetector.BuildDeclarationHeads (cyclomatic 20) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6368— JsDuplicationDetector.BuildDeclarationHeads has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ModuleSyntaxScanner.TryCommonJsExport (cyclomatic 20) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1094— ModuleSyntaxScanner.TryCommonJsExport has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AccessibilityAnalyzer.ConditionalToggleStateUnexposed (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4302— AccessibilityAnalyzer.ConditionalToggleStateUnexposed 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.
AggregateTransactionAnalyzer.Analyze (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/AggregateTransactionAnalyzer.cs:67— AggregateTransactionAnalyzer.Analyze has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArchitectureModelAnalyzer.StatefulSingletons (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:852— ArchitectureModelAnalyzer.StatefulSingletons has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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.
CsprojReferenceGraph.ClassifyLayer (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:813— CsprojReferenceGraph.ClassifyLayer has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LogicDefectAnalyzer.InspectContradictedHandoff (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:2603— LogicDefectAnalyzer.InspectContradictedHandoff has cyclomatic complexity 20 (threshold 15). Of this number, 17 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MarkupTaintPass.CollectEdges (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:585— MarkupTaintPass.CollectEdges 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.
RepoProfiler.DetectDdd (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:143— RepoProfiler.DetectDdd has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RubyDomainConventions.IsStructuralAggregate (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:399— RubyDomainConventions.IsStructuralAggregate has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
SupplyChainHygieneAnalyzer.Analyze (cyclomatic 20) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:355— SupplyChainHygieneAnalyzer.Analyze has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ProductionReadinessAnalyzer.HasDataVolumeMount (cyclomatic 20) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2334— ProductionReadinessAnalyzer.HasDataVolumeMount 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. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
ProductionReadinessAnalyzer.HasOrchestratedPublishTarget (cyclomatic 20) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7036— ProductionReadinessAnalyzer.HasOrchestratedPublishTarget has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 7061). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
VacuousFormatGate.CommandPositions (cyclomatic 20) engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:270— VacuousFormatGate.CommandPositions 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.
DiskSourceFiles.Enumerate (cyclomatic 20) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1026— DiskSourceFiles.Enumerate has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table. This is NOT this file's highest cyclomatic complexity: DiskSourceFiles.IsNeverProductionSourceFile (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 method is counted neither in this dimension's figures nor in its score.
RoslynTestQualityCollector.PublicHost (cyclomatic 20) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:861— RoslynTestQualityCollector.PublicHost has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RoslynTestQualityCollector.DetectSwallowedFailure (cyclomatic 20) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:2035— RoslynTestQualityCollector.DetectSwallowedFailure 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.
ReportViewModelFactory.OwaspCategory (cyclomatic 20) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:2810— ReportViewModelFactory.OwaspCategory has cyclomatic complexity 20 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CloneSpanShape.Skeleton (cyclomatic 20) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4506— CloneSpanShape.Skeleton 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.
GodClassAnalyzer.AbsorbModuleRowsIntoFileRows (cyclomatic 20) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:711— GodClassAnalyzer.AbsorbModuleRowsIntoFileRows 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.
DeclaredDependencies.FixSatisfiesOpenPythonRequirement (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:655— DeclaredDependencies.FixSatisfiesOpenPythonRequirement 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.
DockerfileShapeRuleFilter.Filter (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:161— DockerfileShapeRuleFilter.Filter 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.
ScanParsers.OsvNuGetFixVersions (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1607— ScanParsers.OsvNuGetFixVersions 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.
UnverifiedRemoteInstallerScan.FindingsInStage (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:579— UnverifiedRemoteInstallerScan.FindingsInStage 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.
UnverifiedRemoteInstallerScan.OutputPath (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1228— UnverifiedRemoteInstallerScan.OutputPath 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.
UnverifiedTrustAnchorScan.FetchLine (cyclomatic 20) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedTrustAnchorScan.cs:360— UnverifiedTrustAnchorScan.FetchLine 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.
RepoFindings.razor › OnInitializedAsync (cyclomatic 20) src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:688— RepoFindings.razor › OnInitializedAsync has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
FSharpProvider.CollectUntypedBodies (cyclomatic 20) engine/src/CodeHealth.CodeModel.FSharp/FSharpProvider.fs:86— FSharpProvider.CollectUntypedBodies has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
arch_corpus.main (cyclomatic 20) tools/multilang/arch_corpus.py:141— arch_corpus.main 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.
audit-rubrics.main (cyclomatic 20) tools/train/audit-rubrics.py:36— audit-rubrics.main 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.
holdout-draw.main (cyclomatic 20) tools/train/holdout-draw.py:43— holdout-draw.main 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.
main.Scan (cyclomatic 20) engine/sidecars/go/scan.go:18— main.Scan has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to one function literal inside it that branches (line 50). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
IndirectionAnalyzer.AnalyzeAsync (cyclomatic 19) engine/src/CodeHealth.Core/Architecture/IndirectionAnalyzer.cs:314— IndirectionAnalyzer.AnalyzeAsync 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.
LineBasedGodClassDetector.GoStructGrainScan (cyclomatic 19) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:325— LineBasedGodClassDetector.GoStructGrainScan has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NeutralFileLengthScanner.LiteralFreeSkeleton (cyclomatic 19) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1075— NeutralFileLengthScanner.LiteralFreeSkeleton 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.
ComplianceSecurityAnalyzer.ScanOptInGates (cyclomatic 19) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3858— ComplianceSecurityAnalyzer.ScanOptInGates has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnityLockfileReader.ReadRegistryDirect (cyclomatic 19) engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:128— UnityLockfileReader.ReadRegistryDirect has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RoslynExplicitDebtCollector.CollectWriteOnlyPrivateFields (cyclomatic 19) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1310— RoslynExplicitDebtCollector.CollectWriteOnlyPrivateFields 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.
UpstreamAttribution.HeaderBanner (cyclomatic 19) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1803— UpstreamAttribution.HeaderBanner 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.
DirectoryForkDetector.Analyze (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:154— DirectoryForkDetector.Analyze has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendBundlerConfigRefs.CollectJsonBuildManifestEntries (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1161— FrontendBundlerConfigRefs.CollectJsonBuildManifestEntries 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.
FrontendDependencyHygiene.DeclaredEntryTargetsAllAbsent (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:652— FrontendDependencyHygiene.DeclaredEntryTargetsAllAbsent 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.
FrontendMarkupRefs.ExtractSrcAttribute (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/FrontendMarkupRefs.cs:394— FrontendMarkupRefs.ExtractSrcAttribute 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.
FrontendTestAndDocRefs.CollectTestIncludeGlobs (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:71— FrontendTestAndDocRefs.CollectTestIncludeGlobs has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendTestReachability.EggBootReached (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:2033— FrontendTestReachability.EggBootReached 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.
JsFunctionScanner.FindBodyOpen (cyclomatic 19) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:824— JsFunctionScanner.FindBodyOpen 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. This is NOT this file's highest cyclomatic complexity: JsFunctionScanner.ClassifyOpenBrace (cyclomatic 30) 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.
TaggedTemplateMarkupProducer.Read (cyclomatic 19) engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:69— TaggedTemplateMarkupProducer.Read 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.
TemplateLanguageMarkupProducer.EndOfBladeDirective (cyclomatic 19) engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:361— TemplateLanguageMarkupProducer.EndOfBladeDirective 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.
MaturityAnalyzer.TermFoundInRepo (cyclomatic 19) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:348— MaturityAnalyzer.TermFoundInRepo has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AccessibilityAnalyzer.PureQueryHelperNames (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:745— AccessibilityAnalyzer.PureQueryHelperNames 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.
AccessibilityAnalyzer.AppAssignsDocumentTitleAtRuntime (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7888— AccessibilityAnalyzer.AppAssignsDocumentTitleAtRuntime 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.
DataShapeSmellAnalyzer.InspectSilentDefault (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/DataShapeSmellAnalyzer.cs:148— DataShapeSmellAnalyzer.InspectSilentDefault has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DomainModelAnalyzer.DomainReferencesInfrastructure (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4592— DomainModelAnalyzer.DomainReferencesInfrastructure has cyclomatic complexity 19 (threshold 15). Of this number, 16 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ErlangDomainConventions.DualWrites (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/ErlangDomainConventions.cs:172— ErlangDomainConventions.DualWrites has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ErlangDomainConventions.Ed1Gated (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.
EventDrivenAnalyzer.EventCommandShape (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:927— EventDrivenAnalyzer.EventCommandShape 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.
JavaDomainConventions.IsStructuralAggregate (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:510— JavaDomainConventions.IsStructuralAggregate has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ModelAwareLlmJudge.ResolveId (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/ModelAwareLlmJudge.cs:589— ModelAwareLlmJudge.ResolveId has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RubyDomainConventions.IsRubyDomainCommand (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:224— RubyDomainConventions.IsRubyDomainCommand 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.
ComposePsParser.ParseWebTargets (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/ComposePsParser.cs:28— ComposePsParser.ParseWebTargets 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.
ScalaDomainConventions.AnemicEntities (cyclomatic 19) engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:856— ScalaDomainConventions.AnemicEntities 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.
DartAnalyzerExclusions.Inspect (cyclomatic 19) engine/src/CodeHealth.Core/Readiness/DartAnalyzerExclusions.cs:86— DartAnalyzerExclusions.Inspect 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.
ProductionReadinessAnalyzer.HasPublishVerbInPipelineNamedScript (cyclomatic 19) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7115— ProductionReadinessAnalyzer.HasPublishVerbInPipelineNamedScript has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
CodebaseValuator.Compute (cyclomatic 19) engine/src/CodeHealth.Core/Scoring/CodebaseValuation.cs:59— CodebaseValuator.Compute 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.
DiskTestScanner.VbaTestSourceExtensions (cyclomatic 19) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:584— DiskTestScanner.VbaTestSourceExtensions has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
JsTestQualityCensus.Collect (cyclomatic 19) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:80— JsTestQualityCensus.Collect 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.
NodeTestReliabilityCollector.ParseJestShaped (cyclomatic 19) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:535— NodeTestReliabilityCollector.ParseJestShaped 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.
DsmSvg.Render (cyclomatic 19) engine/src/CodeHealth.Reporting/Svg/DsmSvg.cs:38— DsmSvg.Render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReportViewModelFactory.BuildDimensionCards (cyclomatic 19) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1555— ReportViewModelFactory.BuildDimensionCards has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to one function literal inside it that branches (line 1556). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
DuplicationAnalyzer.ForkFamilies (cyclomatic 19) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1065— DuplicationAnalyzer.ForkFamilies has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DuplicationAnalyzer.GuardAsymmetryCaveat (cyclomatic 19) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2847— DuplicationAnalyzer.GuardAsymmetryCaveat has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DuplicationAnalyzer.DeclarationValidatesParameter (cyclomatic 19) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3309— DuplicationAnalyzer.DeclarationValidatesParameter has cyclomatic complexity 19 (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.
ComplexityScoring.BuildResult (cyclomatic 19) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/ComplexityScoring.cs:831— ComplexityScoring.BuildResult has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to one function literal inside it that branches. 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: ComplexityScoring.RemediationFor (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 method is counted neither in this dimension's figures nor in its score.
ComposeMutableServiceImageScan.Services (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeMutableServiceImageScan.cs:135— ComposeMutableServiceImageScan.Services 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.
ConfigCredentialBindingScan.LooksLikeCommittedCredential (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:457— ConfigCredentialBindingScan.LooksLikeCommittedCredential has cyclomatic complexity 19 (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.
DockerfileShapeRuleFilter.EveryRegistryBaseIsTagged (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:461— DockerfileShapeRuleFilter.EveryRegistryBaseIsTagged 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.
DockerfileShapeRuleFilter.DropsPrivilegeAtStart (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:709— DockerfileShapeRuleFilter.DropsPrivilegeAtStart 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.
NamelessWorkloadNormalisedScan.Normalise (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadNormalisedScan.cs:222— NamelessWorkloadNormalisedScan.Normalise 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.
ScanParsers.GoAffectedImports (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3269— ScanParsers.GoAffectedImports 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.
SocketAndUpgradeRecheck.NotGorillaUpgradeCall (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:270— SocketAndUpgradeRecheck.NotGorillaUpgradeCall 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.
WorkflowInputGateRecheck.AdmitsOnlyShellSafeText (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:521— WorkflowInputGateRecheck.AdmitsOnlyShellSafeText 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.
SupplyChainProvenanceAnalyzer.FunctionKeepsPositionalInProcess (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9719— SupplyChainProvenanceAnalyzer.FunctionKeepsPositionalInProcess 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.
SupplyChainProvenanceAnalyzer.UninvokedGoReleaserManifest (cyclomatic 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleaseTrigger.cs:88— SupplyChainProvenanceAnalyzer.UninvokedGoReleaserManifest has cyclomatic complexity 19 (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.
ModelBuilder.WireTypes (cyclomatic 19) engine/src/CodeHealth.CodeModel.Jvm/Builder.cs:125— ModelBuilder.WireTypes 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.
Branches.walk (cyclomatic 19) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Branches.kt:40— Branches.walk has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Handler._proxy (cyclomatic 19) tools/qwen-poc/effort-proxy.py:54— Handler._proxy 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.
adjudication.audit_rounds (cyclomatic 19) tools/train/adjudication.py:256— adjudication.audit_rounds 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.
fallback-judge.cmd_run (cyclomatic 19) tools/train/fallback-judge.py:210— fallback-judge.cmd_run 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.
fallback-judge.shape_check (cyclomatic 19) tools/train/fallback-judge.py:293— fallback-judge.shape_check has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
report_detection_delta.main (cyclomatic 19) tools/train/report_detection_delta.py:419— report_detection_delta.main has cyclomatic complexity 19 (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.
BranchWalker.scanExpr (cyclomatic 19) engine/sidecars/php-frontend/body.php:160— BranchWalker.scanExpr 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.
VbBranchExtractor.Walk (cyclomatic 18) engine/src/CodeHealth.Core/CodeModel/Roslyn/VbBranchExtractor.cs:50— VbBranchExtractor.Walk has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ChainedFamilyRollup.Cluster (cyclomatic 18) engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:229— ChainedFamilyRollup.Cluster 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.
NeutralMethodLengthScanner.ReadSignature (cyclomatic 18) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:216— NeutralMethodLengthScanner.ReadSignature has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ControlFlowComplexity.CognitiveDriverSummary (cyclomatic 18) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:75— ControlFlowComplexity.CognitiveDriverSummary has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
ComplianceSecurityAnalyzer.ScanWrongDirectionTransform (cyclomatic 18) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2533— ComplianceSecurityAnalyzer.ScanWrongDirectionTransform has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
ComplianceSecurityAnalyzer.PersonalDataCategory (cyclomatic 18) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4220— ComplianceSecurityAnalyzer.PersonalDataCategory has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ComplianceSecurityAnalyzer.C3 (cyclomatic 18) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5270— ComplianceSecurityAnalyzer.C3 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.
UnityRegistryClient.Parse (cyclomatic 18) engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:216— UnityRegistryClient.Parse 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.
VbaSourcePresence.IsVbaTree (cyclomatic 18) engine/src/CodeHealth.Core/Discovery/VbaSourcePresence.cs:47— VbaSourcePresence.IsVbaTree 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.
YamlDisabledConfigScanner.TryConvict (cyclomatic 18) engine/src/CodeHealth.Core/ExplicitDebt/YamlDisabledConfigScanner.cs:531— YamlDisabledConfigScanner.TryConvict 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.
GeneratedRegionScan.Analyse (cyclomatic 18) engine/src/CodeHealth.Core/FileQuality/GeneratedRegionScan.cs:127— GeneratedRegionScan.Analyse 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.
EntryPointCatalog.AddResolvedThroughAlias (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2072— EntryPointCatalog.AddResolvedThroughAlias 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.
FrontendBundlerConfigRefs.CollectBundlerAliases (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:586— FrontendBundlerConfigRefs.CollectBundlerAliases 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.
FrontendDeadCode.GitignoreGlobMatches (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:837— FrontendDeadCode.GitignoreGlobMatches 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.
FrontendScriptCommandRefs.CollectLockfileBinNames (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:748— FrontendScriptCommandRefs.CollectLockfileBinNames 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.
FrontendTestReachability.IsReExportBarrel (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1399— FrontendTestReachability.IsReExportBarrel 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.
FrontendWorkspaceWalk.Walk (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:251— FrontendWorkspaceWalk.Walk 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.
JsDuplicationDetector.TryCollapsePeriodicRun (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4661— JsDuplicationDetector.TryCollapsePeriodicRun has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JsRedundantReDefault.FallbackOf (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs:225— JsRedundantReDefault.FallbackOf 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.
MinifiedJsHeuristics.LooksMinified (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/MinifiedJsHeuristics.cs:565— MinifiedJsHeuristics.LooksMinified 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.
ModuleResolver.ResolveWorkspacePackage (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:719— ModuleResolver.ResolveWorkspacePackage 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.
ModuleResolver.TryResolveExports (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:1016— ModuleResolver.TryResolveExports 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.
NonProductionTreeReadmission.ImportedTrees (cyclomatic 18) engine/src/CodeHealth.Core/Frontend/NonProductionTreeReadmission.cs:54— NonProductionTreeReadmission.ImportedTrees 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.
MarkupParser.EnumerateMarkupFiles (cyclomatic 18) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1455— MarkupParser.EnumerateMarkupFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
AccessibilityAnalyzer.EnumerateScriptFiles (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6212— AccessibilityAnalyzer.EnumerateScriptFiles has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
AccessibilityAnalyzer.CountUnreadTemplateMarkup (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs:128— AccessibilityAnalyzer.CountUnreadTemplateMarkup 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.
AllowlistGate.Prove (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:73— AllowlistGate.Prove has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: AllowlistGate.Classify (cyclomatic 23) 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.
AllowlistGate.Match (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:276— AllowlistGate.Match 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. This is NOT this file's highest cyclomatic complexity: AllowlistGate.Classify (cyclomatic 23) 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.
ArchitectureModelAnalyzer.InterfaceSegregation (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:306— ArchitectureModelAnalyzer.InterfaceSegregation has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CsprojReferenceGraph.Build (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:60— CsprojReferenceGraph.Build 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.
CsprojReferenceGraph.ImportedMsBuildTexts (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:492— CsprojReferenceGraph.ImportedMsBuildTexts has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
DomainConventions.IsEventHandler (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1547— DomainConventions.IsEventHandler has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
DomainModelAnalyzer.PrimitiveDataClumps (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5228— DomainModelAnalyzer.PrimitiveDataClumps has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
GoDomainConventions.IsValueObject (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:168— GoDomainConventions.IsValueObject has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GoDomainConventions.MutatesOwnState (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:2358— GoDomainConventions.MutatesOwnState has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
IncompletenessAnalyzer.ReturnsInterfaceDeclaredNullSentinel (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:2315— IncompletenessAnalyzer.ReturnsInterfaceDeclaredNullSentinel 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.
IncompletenessAnalyzer.RedundantReturnGuardRuns (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4011— IncompletenessAnalyzer.RedundantReturnGuardRuns has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncompletenessAnalyzer.StatementsBothBranchesOpenWith (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4264— IncompletenessAnalyzer.StatementsBothBranchesOpenWith has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
InvocationMatching.FirstMatch (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:29— InvocationMatching.FirstMatch has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
MutationIdempotencyAnalyzer.GatherRoslynAsync (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:667— MutationIdempotencyAnalyzer.GatherRoslynAsync has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.GatherNeutralAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MutationIdempotencyAnalyzer.GatherNeutralAsync (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:769— MutationIdempotencyAnalyzer.GatherNeutralAsync has cyclomatic complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.GatherRoslynAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
PythonDomainConventions.IsStructuralAggregate (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:319— PythonDomainConventions.IsStructuralAggregate has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DeterminismGuard.Evaluate (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/DeterminismGuard.cs:15— DeterminismGuard.Evaluate 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.
StringContractSmellAnalyzer.Collect (cyclomatic 18) engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:130— StringContractSmellAnalyzer.Collect 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.
ProductionReadinessAnalyzer.HasKubernetesPersistentVolumeClaim (cyclomatic 18) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2505— ProductionReadinessAnalyzer.HasKubernetesPersistentVolumeClaim has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
CommittedCoverageReader.ParseGoCoverProfile (cyclomatic 18) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:343— CommittedCoverageReader.ParseGoCoverProfile 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.
RoslynTestQualityCollector.BodyAssertsViaHarness (cyclomatic 18) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1622— RoslynTestQualityCollector.BodyAssertsViaHarness has cyclomatic complexity 18 (threshold 15). Of this number, 10 points are the body's own statements and 8 belong to 2 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
SelfDeclaredUnreliableTests.TestNameAt (cyclomatic 18) engine/src/CodeHealth.Core/Testing/SelfDeclaredUnreliableTests.cs:337— SelfDeclaredUnreliableTests.TestNameAt 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.
ChurnCommitIdentity.CountedChanges (cyclomatic 18) engine/src/CodeHealth.Toolchain/Git/ChurnCommitIdentity.cs:39— ChurnCommitIdentity.CountedChanges 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.
ProcessToolRunner.RunAsync (cyclomatic 18) engine/src/CodeHealth.Toolchain/Tools/ProcessToolRunner.cs:17— ProcessToolRunner.RunAsync has cyclomatic complexity 18 (threshold 15). Of this number, 13 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
ReportViewModelFactory.BuildNewSinceLast (cyclomatic 18) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1352— ReportViewModelFactory.BuildNewSinceLast has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NavigabilityAnalyzer.RunAsync (cyclomatic 18) engine/src/CodeHealth.Dimensions.Architecture/NavigabilityAnalyzer.cs:38— NavigabilityAnalyzer.RunAsync has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeclaredDependencies.RangeAdmits (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1438— DeclaredDependencies.RangeAdmits 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.
JsSiblingScopeReadScan.FindingsIn (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:167— JsSiblingScopeReadScan.FindingsIn 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.
NpmLockGraph.DeclaredEntryAbove (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:333— NpmLockGraph.DeclaredEntryAbove 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.
ScanParsers.LockResolvedMajors (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2812— ScanParsers.LockResolvedMajors has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
SecretNoiseFilter.IsEnumeratedDocExampleBinding (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2647— SecretNoiseFilter.IsEnumeratedDocExampleBinding 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.
SpringSecurityActuatorRecheck.ConfiguresSecurity (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SpringSecurityActuatorRecheck.cs:164— SpringSecurityActuatorRecheck.ConfiguresSecurity 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.
SupplyChainProvenanceAnalyzer.ScriptBlocks (cyclomatic 18) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9471— SupplyChainProvenanceAnalyzer.ScriptBlocks 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.
ChangeCouplingAnalyzer.IsVersionStampFile (cyclomatic 18) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2679— ChangeCouplingAnalyzer.IsVersionStampFile has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
DecisionReportsList.razor › LoadGalleryAsync (cyclomatic 18) src/Kennel.Assay.Core/DecisionReports/Ui/DecisionReportsList.razor:309— DecisionReportsList.razor › LoadGalleryAsync has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Emitter.bufferBody (cyclomatic 18) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Emitter.java:234— Emitter.bufferBody has cyclomatic complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
check.main (cyclomatic 18) engine/sidecars/java-spoon/selftest/check.py:32— check.main has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
build_dimension_noise.load_language (cyclomatic 18) tools/depthnoise/build_dimension_noise.py:194— build_dimension_noise.load_language 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.
render_depth_noise.render (cyclomatic 18) tools/depthnoise/render_depth_noise.py:72— render_depth_noise.render 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.
render_dimension_noise.render (cyclomatic 18) tools/depthnoise/render_dimension_noise.py:156— render_dimension_noise.render 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.
dod_gate.main (cyclomatic 18) tools/multilang/dod_gate.py:27— dod_gate.main 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.
scan.warn_image_stale (cyclomatic 18) tools/multilang/scan.py:302— scan.warn_image_stale 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.
diff.compare (cyclomatic 18) tools/rescan/diff.py:102— diff.compare has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
programme-status.stale_window_report (cyclomatic 18) tools/train/programme-status.py:260— programme-status.stale_window_report 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.
programme-status.divergent_gold_report (cyclomatic 18) tools/train/programme-status.py:401— programme-status.divergent_gold_report 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.
report_verification.main (cyclomatic 18) tools/train/report_verification.py:163— report_verification.main has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.dataLiteralMaskOver (cyclomatic 18) engine/sidecars/go/bodylines.go:306— main.dataLiteralMaskOver has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 337, 322). 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.
extractor.collectInterfaceAssertions (cyclomatic 18) engine/sidecars/go/implements.go:114— extractor.collectInterfaceAssertions has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity· main (cyclomatic 18) · ×1
main (cyclomatic 18) tools/localdev/ui/capture.mjs:105— main has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 11 function items inside it that branch (card, (anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ApiSurfaceExtractor.ScanControllerMethods (cyclomatic 17) engine/src/CodeHealth.Core/ApiSurface/ApiSurfaceExtractor.cs:349— ApiSurfaceExtractor.ScanControllerMethods has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RoslynMethodBody.StripCommentsAndStrings (cyclomatic 17) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynMethodBody.cs:259— RoslynMethodBody.StripCommentsAndStrings has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LineBasedGodClassDetector.ContractRepeatedMemberSurplus (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:718— LineBasedGodClassDetector.ContractRepeatedMemberSurplus has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NeutralFileLengthScanner.RustImplSubject (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:496— NeutralFileLengthScanner.RustImplSubject has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RazorCodeVirtualizer.FindMatchingBrace (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:225— RazorCodeVirtualizer.FindMatchingBrace has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RazorCodeVirtualizer.SkipString (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:281— RazorCodeVirtualizer.SkipString has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RoslynDuplicationDetector.AppendRenameClones (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2573— RoslynDuplicationDetector.AppendRenameClones has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
RoslynDuplicationDetector.IsSelfContainedTestSupportModule (cyclomatic 17) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:3021— RoslynDuplicationDetector.IsSelfContainedTestSupportModule has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FileSystemDocumentationCollector.CollectAsync (cyclomatic 17) engine/src/CodeHealth.Core/Docs/FileSystemDocumentationCollector.cs:19— FileSystemDocumentationCollector.CollectAsync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RoslynDeadCodeDetector.IsReflectivelyRegistered (cyclomatic 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:780— RoslynDeadCodeDetector.IsReflectivelyRegistered has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RoslynExplicitDebtCollector.IsTagShaped (cyclomatic 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1852— RoslynExplicitDebtCollector.IsTagShaped 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.
RoslynExplicitDebtCollector.IllustrationBlockLines (cyclomatic 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:2844— RoslynExplicitDebtCollector.IllustrationBlockLines has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FrontendBoundaries.IsNonProductionImporter (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:2103— FrontendBoundaries.IsNonProductionImporter has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendDeadCode.FindUnregisteredContributions (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:330— FrontendDeadCode.FindUnregisteredContributions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendEngineDimensions.SiblingFamilyFindings (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:1357— FrontendEngineDimensions.SiblingFamilyFindings has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
FrontendManifestEntryPoints.CollectRegistryManifestFiles (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:138— FrontendManifestEntryPoints.CollectRegistryManifestFiles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendScriptCommandRefs.CollectPnpmLockPeerContracts (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:961— FrontendScriptCommandRefs.CollectPnpmLockPeerContracts has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FrontendTestReachability.ForeignBrowserSuiteReached (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1945— FrontendTestReachability.ForeignBrowserSuiteReached has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.RecogniseDeclarationRun (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:1841— JsDuplicationDetector.RecogniseDeclarationRun has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDuplicationDetector.MatchWholesale (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5297— JsDuplicationDetector.MatchWholesale has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Scanner.TryScanJsxTypeArguments (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/JsLexer.Jsx.cs:532— Scanner.TryScanJsxTypeArguments has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ModuleSyntaxScanner.SkipReturnTypeAnnotation (cyclomatic 17) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1568— ModuleSyntaxScanner.SkipReturnTypeAnnotation has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MaturityAnalyzer.HasPerPackageSrcLayout (cyclomatic 17) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3109— MaturityAnalyzer.HasPerPackageSrcLayout has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ArchitectureModelAnalyzer.TryReadRegistration (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1888— ArchitectureModelAnalyzer.TryReadRegistration has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DomainModelAnalyzer.PrimitiveDataClumps (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:453— DomainModelAnalyzer.PrimitiveDataClumps has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
EventDrivenAnalyzer.MessageTypesHandledBy (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:551— EventDrivenAnalyzer.MessageTypesHandledBy has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
EventSourcingAnalyzer.ImmutableEvents (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1007— EventSourcingAnalyzer.ImmutableEvents has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
GoDomainConventions.FoldMethods (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:846— GoDomainConventions.FoldMethods has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GoDomainConventions.GoHttpReadHandlerLeak (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:1185— GoDomainConventions.GoHttpReadHandlerLeak has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
GoDomainConventions.CrossContextReferenceIdFields (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:3015— GoDomainConventions.CrossContextReferenceIdFields has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncompletenessAnalyzer.DebugOnlyBoundChecks (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:1292— IncompletenessAnalyzer.DebugOnlyBoundChecks has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IncompletenessAnalyzer.ApplyOneHopReachabilityAsync (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4645— IncompletenessAnalyzer.ApplyOneHopReachabilityAsync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InvocationMatching.StripCommentsAndStrings (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:399— InvocationMatching.StripCommentsAndStrings has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
MarkupTaintPass.CollectAsync (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:334— MarkupTaintPass.CollectAsync has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PhpDomainConventions.IsStructuralAggregate (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:150— PhpDomainConventions.IsStructuralAggregate has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RepoProfiler.DetectEventDriven (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:563— RepoProfiler.DetectEventDriven has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
RustDomainConventions.RawPrimitiveIds (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:541— RustDomainConventions.RawPrimitiveIds has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RustDomainConventions.RustDualWrites (cyclomatic 17) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:905— RustDomainConventions.RustDualWrites has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to 5 function literals inside it that branch. 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.
CiWorkflowReader.TopLevelTriggers (cyclomatic 17) engine/src/CodeHealth.Core/Readiness/CiWorkflowReader.cs:834— CiWorkflowReader.TopLevelTriggers has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
NativeSecretScanner.IsExcludedPath (cyclomatic 17) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:542— NativeSecretScanner.IsExcludedPath 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.
CommittedCoverageReader.MergeLcovPerFile (cyclomatic 17) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1042— CommittedCoverageReader.MergeLcovPerFile has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CommittedCoverageReader.MergeGoCoverProfilePerFile (cyclomatic 17) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1111— CommittedCoverageReader.MergeGoCoverProfilePerFile has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiskTestScanner.VbaContainerTestSourceExtensions (cyclomatic 17) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:445— DiskTestScanner.VbaContainerTestSourceExtensions has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DiskTestScanner.JsTestFiles (cyclomatic 17) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:919— DiskTestScanner.JsTestFiles has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
JsTestQualityCensus.DeclarationBody (cyclomatic 17) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:657— JsTestQualityCensus.DeclarationBody has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PythonTestCensus.BlankString (cyclomatic 17) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:209— PythonTestCensus.BlankString has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SelfDeclaredUnreliableTests.Find (cyclomatic 17) engine/src/CodeHealth.Core/Testing/SelfDeclaredUnreliableTests.cs:182— SelfDeclaredUnreliableTests.Find has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ChangeSetBuilder.MergeCommitSubsetShadows (cyclomatic 17) engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:222— ChangeSetBuilder.MergeCommitSubsetShadows has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
OsvDependencyVulnerabilityArm.CollectAsync (cyclomatic 17) engine/src/CodeHealth.Dimensions.Security/OsvScannerAnalyzer.cs:41— OsvDependencyVulnerabilityArm.CollectAsync has cyclomatic complexity 17 (threshold 15). Of this number, 11 points are the body's own statements and 6 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeclaredDependencies.ParsePyProject (cyclomatic 17) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1933— DeclaredDependencies.ParsePyProject has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DockerfileShapeRuleFilter.EveryPackageStepMountsTheCache (cyclomatic 17) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:1172— DockerfileShapeRuleFilter.EveryPackageStepMountsTheCache has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
UnverifiedTrustAnchorScan.OffendingFetch (cyclomatic 17) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedTrustAnchorScan.cs:177— UnverifiedTrustAnchorScan.OffendingFetch has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SupplyChainProvenanceAnalyzer.JobSteps (cyclomatic 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2140— SupplyChainProvenanceAnalyzer.JobSteps has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ChangeCouplingAnalyzer.NamesRepoSubtypeOf (cyclomatic 17) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4243— ChangeCouplingAnalyzer.NamesRepoSubtypeOf has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TestReliabilityAnalyzer.PolyglotUnmeasured (cyclomatic 17) engine/src/CodeHealth.Dimensions.Testing/TestReliabilityAnalyzer.cs:868— TestReliabilityAnalyzer.PolyglotUnmeasured 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.
FSharpBody.buildLiterals (cyclomatic 17) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:300— FSharpBody.buildLiterals has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
verified_history.append_verified_history (cyclomatic 17) tools/depthnoise/verified_history.py:99— verified_history.append_verified_history has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
census.audit (cyclomatic 17) tools/rescan/census.py:136— census.audit 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.
judge_assignment.render_markdown (cyclomatic 17) tools/train/judge_assignment.py:1626— judge_assignment.render_markdown has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
report_round.self_check (cyclomatic 17) tools/train/report_round.py:376— report_round.self_check 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.
run-arms.main (cyclomatic 17) tools/train/run-arms.py:72— run-arms.main has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sample-by-kind.main (cyclomatic 17) tools/train/sample-by-kind.py:64— sample-by-kind.main 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.
SymbolCollector.enterNode (cyclomatic 17) engine/sidecars/php-frontend/main.php:141— SymbolCollector.enterNode has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
bodyResolver.recoverCatchOf (cyclomatic 17) engine/sidecars/go/bodyshapes.go:468— bodyResolver.recoverCatchOf has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 472, 502). 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.
extractor.extractPackage (cyclomatic 17) engine/sidecars/go/extract.go:55— extractor.extractPackage has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
extractor.assertedTypeFqn (cyclomatic 17) engine/sidecars/go/implements.go:150— extractor.assertedTypeFqn has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BoundaryCouplingDetector.ScanRoslynAsync (cyclomatic 16) engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:86— BoundaryCouplingDetector.ScanRoslynAsync 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.
SliceLocalityDetector.Collaborators (cyclomatic 16) engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:115— SliceLocalityDetector.Collaborators 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.
SourceClassifier.IsTestDirectorySegment (cyclomatic 16) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:291— SourceClassifier.IsTestDirectorySegment 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.
LineBasedGodClassDetector.DisjointFieldClusters (cyclomatic 16) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:415— LineBasedGodClassDetector.DisjointFieldClusters 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.
NeutralFileLengthScanner.SkipNumber (cyclomatic 16) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1246— NeutralFileLengthScanner.SkipNumber has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NeutralMethodLengthScanner.DeclaredMethodsByFile (cyclomatic 16) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:389— NeutralMethodLengthScanner.DeclaredMethodsByFile 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.
LineLexer.CharLiteralEnd (cyclomatic 16) engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:444— LineLexer.CharLiteralEnd 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.
ControlFlowComplexity.DominantShape (cyclomatic 16) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:168— ControlFlowComplexity.DominantShape has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComplianceSecurityAnalyzer.DetectSerializedSecretLogging (cyclomatic 16) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1610— ComplianceSecurityAnalyzer.DetectSerializedSecretLogging has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
HostedHttpSurfaceScan.RoleOf (cyclomatic 16) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:326— HostedHttpSurfaceScan.RoleOf 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.
SwiftPackageHygiene.StripComments (cyclomatic 16) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:503— SwiftPackageHygiene.StripComments 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.
FrontendMetaDimensions.Build (cyclomatic 16) engine/src/CodeHealth.Core/Discovery/FrontendMetaDimensions.cs:304— FrontendMetaDimensions.Build has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 312). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This is NOT this file's highest cyclomatic complexity: FrontendMetaDimensions.TestReachabilityFix (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.
RoslynExplicitDebtCollector.CollectPragmaDisables (cyclomatic 16) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3974— RoslynExplicitDebtCollector.CollectPragmaDisables 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. This is NOT this file's highest cyclomatic complexity: RoslynExplicitDebtCollector.ExclusionScope (cyclomatic 17) 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.
ObsoleteSuppressionScopes.Build (cyclomatic 16) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5720— ObsoleteSuppressionScopes.Build 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. This is NOT this file's highest cyclomatic complexity: RoslynExplicitDebtCollector.ExclusionScope (cyclomatic 17) 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.
FrontendBundlerConfigRefs.CollectFrameworkCliEntries (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1281— FrontendBundlerConfigRefs.CollectFrameworkCliEntries 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.
FrontendComplexity.Analyze (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendComplexity.cs:79— FrontendComplexity.Analyze 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.
FrontendDeadCode.GitignorePatternMayCover (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:772— FrontendDeadCode.GitignorePatternMayCover 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.
FrontendEmittedTemplateRefs.AddEmittedTemplateTreeRefs (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:31— FrontendEmittedTemplateRefs.AddEmittedTemplateTreeRefs 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.
FrontendManifestEntryPoints.AddMiniProgramComponents (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:387— FrontendManifestEntryPoints.AddMiniProgramComponents 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.
FrontendManifestEntryPoints.CollectWebExtensionScriptRefs (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:535— FrontendManifestEntryPoints.CollectWebExtensionScriptRefs 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.
FrontendToolAndRuntimeRefs.CollectToolConfigModuleRefs (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:29— FrontendToolAndRuntimeRefs.CollectToolConfigModuleRefs 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.
JsComplexity.ComputeCyclomatic (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:199— JsComplexity.ComputeCyclomatic 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.
JsDuplicationDetector.IsSpecialisationDelegationRun (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3702— JsDuplicationDetector.IsSpecialisationDelegationRun 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.
JsDuplicationDetector.TrimWiringExtents (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3932— JsDuplicationDetector.TrimWiringExtents 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.
JsDuplicationDetector.IsDestructuringListing (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:7345— JsDuplicationDetector.IsDestructuringListing has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Scanner.DecodeUnicodeEscape (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:543— Scanner.DecodeUnicodeEscape 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.
ModuleResolver.ConditionAlternatives (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:936— ModuleResolver.ConditionAlternatives 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.
ModuleSyntaxScanner.ScanExportClause (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:868— ModuleSyntaxScanner.ScanExportClause 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.
PlatformSubstitutionTable.From (cyclomatic 16) engine/src/CodeHealth.Core/Frontend/PlatformSubstitutionTable.cs:51— PlatformSubstitutionTable.From has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitRefStore.Resolve (cyclomatic 16) engine/src/CodeHealth.Core/Git/GitRefStore.cs:27— GitRefStore.Resolve has cyclomatic complexity 16 (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.
MarkupParser.BlankUnquotedExpressionAttributeValues (cyclomatic 16) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:986— MarkupParser.BlankUnquotedExpressionAttributeValues 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.
MaturityAnalyzer.PubPackageLayoutSeparation (cyclomatic 16) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2544— MaturityAnalyzer.PubPackageLayoutSeparation has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
AccessibilityAnalyzer.VisualAndMotion (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4496— AccessibilityAnalyzer.VisualAndMotion 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.
AccessibilityAnalyzer.IsHeadingOnlyScriptHost (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7980— AccessibilityAnalyzer.IsHeadingOnlyScriptHost 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.
AllowlistGate.Evaluate (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:217— AllowlistGate.Evaluate 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. This is NOT this file's highest cyclomatic complexity: AllowlistGate.Classify (cyclomatic 23) 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.
CoherenceSmellAnalyzer.ScanSubsumedOperands (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:123— CoherenceSmellAnalyzer.ScanSubsumedOperands 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. This is NOT this file's highest cyclomatic complexity: CoherenceSmellAnalyzer.Parse (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.
CsprojReferenceGraph.HasTestFrameworkSignal (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:303— CsprojReferenceGraph.HasTestFrameworkSignal has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
EventSourcingAnalyzer.References (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1280— EventSourcingAnalyzer.References has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
HeadingLabelQualityAnalyzer.AnalyzeAsync (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:24— HeadingLabelQualityAnalyzer.AnalyzeAsync 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.
IncompletenessAnalyzer.ComparisonsDecidedByNaN (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4176— IncompletenessAnalyzer.ComparisonsDecidedByNaN 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.
SymbolHelpers.IsStronglyTypedId (cyclomatic 16) engine/src/CodeHealth.Core/ModelAware/SymbolHelpers.cs:727— SymbolHelpers.IsStronglyTypedId 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.
PipelineVersionOutputScan.StepContext (cyclomatic 16) engine/src/CodeHealth.Core/Readiness/PipelineVersionOutputScan.cs:245— PipelineVersionOutputScan.StepContext 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.
ProductionReadinessAnalyzer.HasProductionContainerImage (cyclomatic 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6307— ProductionReadinessAnalyzer.HasProductionContainerImage has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: ProductionReadinessAnalyzer.HasDedicatedSastSignal (cyclomatic 48) 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.
CodebaseSize.CountTestLocFromCsprojPathsAsync (cyclomatic 16) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:305— CodebaseSize.CountTestLocFromCsprojPathsAsync has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CredentialScannerAllowlist.ParsePathPatterns (cyclomatic 16) engine/src/CodeHealth.Core/Security/CredentialScannerAllowlist.cs:118— CredentialScannerAllowlist.ParsePathPatterns 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.
NativeSecretScanner.IsSigningKeyValue (cyclomatic 16) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:1383— NativeSecretScanner.IsSigningKeyValue has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DiskTestScanner.DeclaresJsTestRunner (cyclomatic 16) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1031— DiskTestScanner.DeclaresJsTestRunner 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.
DiskTestScanner.HasPesterTestSuite (cyclomatic 16) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1192— DiskTestScanner.HasPesterTestSuite has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
NodeBrowserProvision.ExpectedRevisions (cyclomatic 16) engine/src/CodeHealth.Core/Testing/NodeBrowserProvision.cs:107— NodeBrowserProvision.ExpectedRevisions has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
PythonTestCensus.Strip (cyclomatic 16) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:161— PythonTestCensus.Strip has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RoslynTestQualityCollector.IsFetchArgument (cyclomatic 16) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:905— RoslynTestQualityCollector.IsFetchArgument 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.
TestProjectClassifier.FileTier (cyclomatic 16) engine/src/CodeHealth.Core/Testing/TestProjectClassifier.cs:95— TestProjectClassifier.FileTier has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
DegradedDiagnosticsReport.Render (cyclomatic 16) engine/src/CodeHealth.Cli/Diagnostics/DegradedDiagnosticsReport.cs:30— DegradedDiagnosticsReport.Render 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.
DegradedDiagnosticsReport.AppendSolutionAndProjectFiles (cyclomatic 16) engine/src/CodeHealth.Cli/Diagnostics/DegradedDiagnosticsReport.cs:304— DegradedDiagnosticsReport.AppendSolutionAndProjectFiles has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ChangelogNarrator.DescribeEntryAsync (cyclomatic 16) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:726— ChangelogNarrator.DescribeEntryAsync has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
EngineeringReportRenderer.RenderMarkdown (cyclomatic 16) engine/src/CodeHealth.Reporting/Engineering/EngineeringReportRenderer.cs:83— EngineeringReportRenderer.RenderMarkdown has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
RuleRecommendationEngine.IsAnalysisGap (cyclomatic 16) engine/src/CodeHealth.Reporting/Recommendations/RuleRecommendationEngine.cs:785— RuleRecommendationEngine.IsAnalysisGap has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ArchitecturalIntegrityAnalyzer.RunAsync (cyclomatic 16) engine/src/CodeHealth.Dimensions.Architecture/ArchitecturalIntegrityAnalyzer.cs:26— ArchitecturalIntegrityAnalyzer.RunAsync has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
DuplicationAnalyzer.IndexShardParents (cyclomatic 16) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1266— DuplicationAnalyzer.IndexShardParents has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CloneSpanShape.DataRunTokens (cyclomatic 16) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3912— CloneSpanShape.DataRunTokens has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComposeHostNamespaceScan.FindingsIn (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:118— ComposeHostNamespaceScan.FindingsIn 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.
DeclaredDependencies.FromRepository (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:768— DeclaredDependencies.FromRepository has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
GenericDecodeAdviceRecheck.GenericValueDecodeInto (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/GenericDecodeAdviceRecheck.cs:103— GenericDecodeAdviceRecheck.GenericValueDecodeInto 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.
GoModuleContextRechecks.GoInstallResolvesThroughEnclosingModule (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/GoModuleContextRechecks.cs:66— GoModuleContextRechecks.GoInstallResolvesThroughEnclosingModule has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NpmLockGraph.NpmLockGraph.ctor (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:72— NpmLockGraph.NpmLockGraph.ctor 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.
PathCombineProvenanceRecheck.ExtractCombineArgs (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:292— PathCombineProvenanceRecheck.ExtractCombineArgs 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.
PowerShellFetchExecScriptRecheck.TextLines (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:102— PowerShellFetchExecScriptRecheck.TextLines 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.
PrimaryConstructorShadow.SkipTypeName (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:283— PrimaryConstructorShadow.SkipTypeName 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.
SecretNoiseFilter.IsDocumentedExampleKeyContext (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2514— SecretNoiseFilter.IsDocumentedExampleKeyContext has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators. This is NOT this file's highest cyclomatic complexity: SecretNoiseFilter.IsContentDigestManifestValue (cyclomatic 18) 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.
SemgrepShapeFilter.TopLevelArguments (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepShapeFilter.cs:429— SemgrepShapeFilter.TopLevelArguments 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.
FileModel.RegionNeutralises (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:742— FileModel.RegionNeutralises 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.
UnpinnedToolchainInstallScan.NodeOffence (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/Scanners/UnpinnedToolchainInstallScan.cs:413— UnpinnedToolchainInstallScan.NodeOffence 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.
SupplyChainProvenanceAnalyzer.UnverifiedBinaryIngests (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1116— SupplyChainProvenanceAnalyzer.UnverifiedBinaryIngests 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.
SupplyChainProvenanceAnalyzer.SoftFailedGatesBeforePublish (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2213— SupplyChainProvenanceAnalyzer.SoftFailedGatesBeforePublish 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.
SupplyChainProvenanceAnalyzer.ScanBuildManifests (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5920— SupplyChainProvenanceAnalyzer.ScanBuildManifests 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.
SupplyChainProvenanceAnalyzer.ScopesEveryJob (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6179— SupplyChainProvenanceAnalyzer.ScopesEveryJob 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.
SupplyChainProvenanceAnalyzer.RequiredStatusContexts (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10655— SupplyChainProvenanceAnalyzer.RequiredStatusContexts 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.
SupplyChainProvenanceAnalyzer.DeclaredPackagingScripts (cyclomatic 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:37— SupplyChainProvenanceAnalyzer.DeclaredPackagingScripts has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
GitMiningSourceFiles.IsConstantEnumerationText (cyclomatic 16) engine/src/CodeHealth.Dimensions.GitMining/GitMiningSourceFiles.cs:718— GitMiningSourceFiles.IsConstantEnumerationText 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. This is NOT this file's highest cyclomatic complexity: GitMiningSourceFiles.Eligible (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.
CoverageAnalyzer.PolyglotUnmeasured (cyclomatic 16) engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs:1267— CoverageAnalyzer.PolyglotUnmeasured has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
LlmAdrConformanceChecker.CheckAsync (cyclomatic 16) engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:23— LlmAdrConformanceChecker.CheckAsync has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 37). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
FSharpBody.gather (cyclomatic 16) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:66— FSharpBody.gather has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Tokenizer.decodeEscapes (cyclomatic 16) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Tokenizer.kt:146— Tokenizer.decodeEscapes 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.
Branches.walk (cyclomatic 16) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Branches.scala:56— Branches.walk has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
build_onboard_manifest.main (cyclomatic 16) tools/multilang/build_onboard_manifest.py:79— build_onboard_manifest.main 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.
adjudication.main (cyclomatic 16) tools/train/adjudication.py:339— adjudication.main 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.
judge-calibration.ask (cyclomatic 16) tools/train/judge-calibration.py:982— judge-calibration.ask 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.
judge-k3-report.render_markdown (cyclomatic 16) tools/train/judge-k3-report.py:360— judge-k3-report.render_markdown 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.
judge-routing.selection (cyclomatic 16) tools/train/judge-routing.py:112— judge-routing.selection 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.
rate_audit.main (cyclomatic 16) tools/train/rate_audit.py:80— rate_audit.main 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.
report_round.fingerprint_rows (cyclomatic 16) tools/train/report_round.py:233— report_round.fingerprint_rows has cyclomatic complexity 16 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
seed-backlog.main (cyclomatic 16) tools/train/seed-backlog.py:80— seed-backlog.main has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
select_todo.main (cyclomatic 16) tools/train/select_todo.py:28— select_todo.main 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.
main.invocationGroups (cyclomatic 16) engine/sidecars/go/bodylines.go:150— main.invocationGroups has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 191, 175). 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.
extractor.refForType (cyclomatic 16) engine/sidecars/go/typerefs.go:27— extractor.refForType has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable. This is NOT this file's highest cyclomatic complexity: main.astRef (cyclomatic 17) 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.
observe-proxy.main (cyclomatic 16) engine/docker/analyzer/render/observe-proxy.mjs:45— observe-proxy.main has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 53, 56, 61, …). 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.
main.main (cyclomatic 16) engine/sidecars/tsjs-frontend/main.mjs:20— main.main has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 3 function literals inside it that branch. To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
Deprecated: xunit — xunit 2.9.3 — Legacy — the publisher's replacement is `xunit.v3`; that is the next major line under a new package id, so the move is a breaking rename rather than a version bump — budget for API changes in the code that uses it, not only the reference swap.
BarePragmaDisable engine/src/CodeHealth.Core/Statistics/DotnetBuildStatistician.cs:478— #pragma warning disable CHA0004 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
DependencyHygieneAnalyzer.RunAsync (cognitive 666) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:130— DependencyHygieneAnalyzer.RunAsync has cognitive complexity 666 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
dimension-routing.main (cognitive 366) tools/train/dimension-routing.py:431— dimension-routing.main has cognitive complexity 366 (threshold 15). Drivers by points: if/else 96 (241 pts), loops 24 (49 pts), ternaries 13 (38 pts), boolean chains 35, error handling 1 (3 pts) (nesting depth added 197). 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.
AnalyzeCommand.ExecuteCoreAsync (cognitive 259) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:171— AnalyzeCommand.ExecuteCoreAsync has cognitive complexity 259 (threshold 15). Of this number, 257 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
MaturityAnalyzer.FolderStructure (cognitive 231) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:881— MaturityAnalyzer.FolderStructure has cognitive complexity 231 (threshold 15). Of this number, 229 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynDuplicationDetector.ScanAsync (cognitive 215) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:524— RoslynDuplicationDetector.ScanAsync has cognitive complexity 215 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BuildDeclarationEntryMask (cognitive 188) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:860— JsDuplicationDetector.BuildDeclarationEntryMask has cognitive complexity 188 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-routing.main (cognitive 179) tools/train/judge-routing.py:253— judge-routing.main has cognitive complexity 179 (threshold 15). Drivers by points: if/else 52 (89 pts), ternaries 25 (54 pts), boolean chains 24, loops 8 (12 pts) (nesting depth added 70). 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.
programme-status.main (cognitive 174) tools/train/programme-status.py:606— programme-status.main has cognitive complexity 174 (threshold 15). Drivers by points: if/else 47 (95 pts), loops 13 (29 pts), ternaries 12 (27 pts), boolean chains 20, error handling 1 (3 pts) (nesting depth added 81). 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.
SecretsHistoryAnalyzer.GateCorpusAndDocumentedExampleFindings (cognitive 172) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:897— SecretsHistoryAnalyzer.GateCorpusAndDocumentedExampleFindings has cognitive complexity 172 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSharpCorrectnessAnalyzer.AnalyzeAsync (cognitive 161) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:27— CSharpCorrectnessAnalyzer.AnalyzeAsync has cognitive complexity 161 (threshold 15). Of this number, 157 points are the body's own statements and 4 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CoverageAnalyzer.RunAsync (cognitive 146) engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs:65— CoverageAnalyzer.RunAsync has cognitive complexity 146 (threshold 15). Of this number, 140 points are the body's own statements and 6 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.AssessEnforcement (cognitive 145) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6348— AccessibilityAnalyzer.AssessEnforcement has cognitive complexity 145 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
agg_holdout5.main (cognitive 143) tools/multilang/agg_holdout5.py:78— agg_holdout5.main has cognitive complexity 143 (threshold 15). Drivers by points: if/else 30 (78 pts), loops 23 (46 pts), ternaries 5 (12 pts), boolean chains 7 (nesting depth added 78). 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.
FrontendBundlerConfigRefs.CollectBundlerEntries (cognitive 137) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:848— FrontendBundlerConfigRefs.CollectBundlerEntries has cognitive complexity 137 (threshold 15). Of this number, 136 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.AnalyzeAsync (cognitive 134) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:146— IncompletenessAnalyzer.AnalyzeAsync has cognitive complexity 134 (threshold 15). Of this number, 133 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendPathLiteralRefs.CollectPathLiteralRefs (cognitive 132) engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:11— FrontendPathLiteralRefs.CollectPathLiteralRefs has cognitive complexity 132 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agg_combined.main (cognitive 132) tools/multilang/agg_combined.py:82— agg_combined.main has cognitive complexity 132 (threshold 15). Drivers by points: if/else 23 (68 pts), loops 24 (50 pts), boolean chains 7, ternaries 5 (7 pts) (nesting depth added 73). 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.
agg_combined4.main (cognitive 132) tools/multilang/agg_combined4.py:103— agg_combined4.main has cognitive complexity 132 (threshold 15). Drivers by points: if/else 18 (64 pts), loops 22 (55 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 84). 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.
agg_combined5.main (cognitive 132) tools/multilang/agg_combined5.py:108— agg_combined5.main has cognitive complexity 132 (threshold 15). Drivers by points: if/else 18 (64 pts), loops 22 (55 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 84). 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.
agg_combined6.main (cognitive 132) tools/multilang/agg_combined6.py:118— agg_combined6.main has cognitive complexity 132 (threshold 15). Drivers by points: if/else 18 (64 pts), loops 22 (55 pts), ternaries 3 (8 pts), boolean chains 5 (nesting depth added 84). 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.
dimension-coverage.main (cognitive 127) tools/multilang/dimension-coverage.py:321— dimension-coverage.main has cognitive complexity 127 (threshold 15). Drivers by points: ternaries 16 (53 pts), if/else 29 (43 pts), loops 12 (23 pts), boolean chains 8 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agg_holdout4.main (cognitive 126) tools/multilang/agg_holdout4.py:66— agg_holdout4.main has cognitive complexity 126 (threshold 15). Drivers by points: if/else 26 (69 pts), loops 22 (46 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 70). 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.
judge-k3-report.main (cognitive 122) tools/train/judge-k3-report.py:128— judge-k3-report.main has cognitive complexity 122 (threshold 15). Drivers by points: if/else 37 (70 pts), boolean chains 19, ternaries 8 (16 pts), loops 10 (15 pts), error handling 1 (2 pts) (nesting depth added 47). 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.
SourceClassifier.EcosystemMarkerVerdict (cognitive 120) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3231— SourceClassifier.EcosystemMarkerVerdict has cognitive complexity 120 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AttributeConsumptionScanner.CollectAsync (cognitive 114) engine/src/CodeHealth.Core/ExplicitDebt/AttributeConsumptionScanner.cs:61— AttributeConsumptionScanner.CollectAsync has cognitive complexity 114 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.RunAsync (cognitive 112) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2625— SupplyChainProvenanceAnalyzer.RunAsync has cognitive complexity 112 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge_verification.main (cognitive 109) tools/train/judge_verification.py:419— judge_verification.main has cognitive complexity 109 (threshold 15). Drivers by points: if/else 34 (56 pts), boolean chains 28, ternaries 7 (13 pts), loops 7 (12 pts) (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.ImportedModulesOf (cognitive 105) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4851— ChangeCouplingAnalyzer.ImportedModulesOf has cognitive complexity 105 (threshold 15). 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.
agg_combined3.main (cognitive 105) tools/multilang/agg_combined3.py:89— agg_combined3.main has cognitive complexity 105 (threshold 15). Drivers by points: if/else 16 (51 pts), loops 20 (43 pts), ternaries 4 (6 pts), boolean chains 5 (nesting depth added 60). 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.
FrontendTestReachability.Analyze (cognitive 104) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:81— FrontendTestReachability.Analyze has cognitive complexity 104 (threshold 15). Of this number, 102 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendModuleGraph.Build (cognitive 103) engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:162— FrontendModuleGraph.Build has cognitive complexity 103 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.S1 (cognitive 102) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5493— ComplianceSecurityAnalyzer.S1 has cognitive complexity 102 (threshold 15). 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.
EventDrivenAnalyzer.OutboxDualWrite (cognitive 100) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1680— EventDrivenAnalyzer.OutboxDualWrite has cognitive complexity 100 (threshold 15). Of this number, 93 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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.
ChangeCouplingAnalyzer.BuildCoupledPairs (cognitive 100) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:736— ChangeCouplingAnalyzer.BuildCoupledPairs has cognitive complexity 100 (threshold 15). Of this number, 99 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer.tokenize (cognitive 98) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Tokenizer.scala:65— Tokenizer.tokenize has cognitive complexity 98 (threshold 15). Drivers by points: if/else 25 (56 pts), loops 8 (24 pts), boolean chains 18 (nesting depth added 47). 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.
RustTestCensus.Strip (cognitive 97) engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:196— RustTestCensus.Strip has cognitive complexity 97 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemberFamilyRollup.Collapse (cognitive 96) engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:102— MemberFamilyRollup.Collapse has cognitive complexity 96 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpstreamAttribution.ForRepo (cognitive 96) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:148— UpstreamAttribution.ForRepo has cognitive complexity 96 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fallback-judge.cmd_score (cognitive 96) tools/train/fallback-judge.py:329— fallback-judge.cmd_score has cognitive complexity 96 (threshold 15). Drivers by points: if/else 28 (64 pts), ternaries 7 (14 pts), loops 9 (13 pts), boolean chains 5 (nesting depth added 47). 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.
EntryPointCatalog.DetectApplication (cognitive 95) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:269— EntryPointCatalog.DetectApplication has cognitive complexity 95 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Tokenizer.tokenize (cognitive 94) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Tokenizer.kt:24— Tokenizer.tokenize has cognitive complexity 94 (threshold 15). Drivers by points: if/else 18 (54 pts), loops 8 (24 pts), boolean chains 16 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agg_holdout6.main (cognitive 94) tools/multilang/agg_holdout6.py:94— agg_holdout6.main has cognitive complexity 94 (threshold 15). Drivers by points: if/else 25 (48 pts), loops 16 (24 pts), ternaries 10 (16 pts), boolean chains 6 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeTestReliabilityCollector.CollectAsync (cognitive 92) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:143— NodeTestReliabilityCollector.CollectAsync has cognitive complexity 92 (threshold 15). Of this number, 88 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
HotspotAnalyzer.RunAsync (cognitive 92) engine/src/CodeHealth.Dimensions.GitMining/HotspotAnalyzer.cs:34— HotspotAnalyzer.RunAsync has cognitive complexity 92 (threshold 15). Of this number, 86 points are the body's own statements and 6 belong to 6 function literals inside it that branch. 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.
DimensionOrchestrator.UnclampedTimeoutFor (cognitive 91) engine/src/CodeHealth.Core/Orchestration/DimensionOrchestrator.cs:523— DimensionOrchestrator.UnclampedTimeoutFor has cognitive complexity 91 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendEngine.ModelGeneratedModules (cognitive 90) engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:142— FrontendEngine.ModelGeneratedModules has cognitive complexity 90 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.Scan (cognitive 90) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:284— ModuleSyntaxScanner.Scan has cognitive complexity 90 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer.tokenize (cognitive 89) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Tokenizer.java:31— Tokenizer.tokenize has cognitive complexity 89 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 8 (24 pts), boolean chains 17, ternaries 2 (6 pts) (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-sweep.main (cognitive 89) tools/train/model-sweep.py:287— model-sweep.main has cognitive complexity 89 (threshold 15). Drivers by points: if/else 22 (51 pts), loops 9 (18 pts), boolean chains 10, error handling 3 (6 pts), ternaries 3 (4 pts) (nesting depth added 42). 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.
FrontendDeadCode.FindUnusedExports (cognitive 88) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1254— FrontendDeadCode.FindUnusedExports has cognitive complexity 88 (threshold 15). Of this number, 86 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.FactsFor (cognitive 88) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4453— ChangeCouplingAnalyzer.FactsFor has cognitive complexity 88 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendDeadCode.CountStandaloneReferences (cognitive 83) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1736— FrontendDeadCode.CountStandaloneReferences has cognitive complexity 83 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.DeclaredWorkspaceMembers (cognitive 83) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:1475— MaturityAnalyzer.DeclaredWorkspaceMembers has cognitive complexity 83 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.WorkflowGrantsWiderThanJobsUse (cognitive 80) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7913— SupplyChainProvenanceAnalyzer.WorkflowGrantsWiderThanJobsUse has cognitive complexity 80 (threshold 15). Of this number, 78 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DartDeadLibraryField.StripNonCode (cognitive 78) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:136— DartDeadLibraryField.StripNonCode has cognitive complexity 78 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.TryMergeNearCloneSegment (cognitive 78) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4204— JsDuplicationDetector.TryMergeNearCloneSegment has cognitive complexity 78 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustInlineTestModule.BlankLiteralsAndComments (cognitive 77) engine/src/CodeHealth.Core/Classification/RustInlineTestModule.cs:170— RustInlineTestModule.BlankLiteralsAndComments has cognitive complexity 77 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.ObservabilityAsync (cognitive 76) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4266— ProductionReadinessAnalyzer.ObservabilityAsync has cognitive complexity 76 (threshold 15). Of this number, 74 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestQualityAnalyzer.RunAsync (cognitive 75) engine/src/CodeHealth.Dimensions.Testing/TestQualityAnalyzer.cs:23— TestQualityAnalyzer.RunAsync has cognitive complexity 75 (threshold 15). Of this number, 69 points are the body's own statements and 6 belong to 6 function literals inside it that branch. 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.
bakeoff.run_model (cognitive 75) tools/llm-bakeoff/bakeoff.py:102— bakeoff.run_model has cognitive complexity 75 (threshold 15). Drivers by points: if/else 14 (37 pts), ternaries 8 (18 pts), boolean chains 11, loops 4 (9 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokenizeBody (cognitive 75) engine/sidecars/ruby-frontend/tokenize.mjs:15— tokenizeBody has cognitive complexity 75 (threshold 15). Drivers by points: if/else 29 (41 pts), boolean chains 19, loops 12 (13 pts), ternaries 2 (nesting depth added 13). Most of this is not in the body itself: 8 of the 75 points are its own statements and the rest belongs to 17 function items inside it that branch (scanPercentBody, stringLiteral, blockComment, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SupplyChainProvenanceAnalyzer.JobsScopedBelowTheirCheckout (cognitive 74) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8161— SupplyChainProvenanceAnalyzer.JobsScopedBelowTheirCheckout has cognitive complexity 74 (threshold 15). Of this number, 72 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
SourceClassifier.ScanStringState (cognitive 73) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:1489— SourceClassifier.ScanStringState has cognitive complexity 73 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectCrossPackageViolations (cognitive 73) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1055— FrontendBoundaries.CollectCrossPackageViolations has cognitive complexity 73 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeSecretScanner.ScanLines (cognitive 73) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:782— NativeSecretScanner.ScanLines has cognitive complexity 73 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndirectionAnalyzer.AnalyzeAsync (cognitive 72) engine/src/CodeHealth.Core/Architecture/IndirectionAnalyzer.cs:140— IndirectionAnalyzer.AnalyzeAsync has cognitive complexity 72 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FSharpSyntaxModel.build (cognitive 71) engine/src/CodeHealth.CodeModel.FSharp/SyntaxModel.fs:605— FSharpSyntaxModel.build has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 11 (21 pts), loops 7 (11 pts), boolean chains 5, error handling 3 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeConcentrationAnalyzer.RunAsync (cognitive 70) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:152— KnowledgeConcentrationAnalyzer.RunAsync has cognitive complexity 70 (threshold 15). Of this number, 67 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TestReliabilityAnalyzer.RunAsync (cognitive 70) engine/src/CodeHealth.Dimensions.Testing/TestReliabilityAnalyzer.cs:60— TestReliabilityAnalyzer.RunAsync has cognitive complexity 70 (threshold 15). Of this number, 69 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.DetectWholesaleFileCopies (cognitive 68) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5081— JsDuplicationDetector.DetectWholesaleFileCopies has cognitive complexity 68 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BestEditedCopy (cognitive 68) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5457— JsDuplicationDetector.BestEditedCopy has cognitive complexity 68 (threshold 15). Of this number, 67 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CouplingAnalyzer.RunAsync (cognitive 68) engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:27— CouplingAnalyzer.RunAsync has cognitive complexity 68 (threshold 15). Of this number, 60 points are the body's own statements and 8 belong to 7 function literals inside it that branch. 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.
LineBasedGodClassDetector.DetectAsync (cognitive 67) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:34— LineBasedGodClassDetector.DetectAsync has cognitive complexity 67 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agg_go.main (cognitive 67) tools/multilang/agg_go.py:63— agg_go.main has cognitive complexity 67 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 11 (23 pts), ternaries 4 (6 pts), boolean chains 2 (nesting depth added 36). 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.
report_round.main (cognitive 65) tools/train/report_round.py:431— report_round.main has cognitive complexity 65 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 24, ternaries 9 (10 pts), loops 4 (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.
ExplicitDebtAnalyzer.RunAsync (cognitive 64) engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:31— ExplicitDebtAnalyzer.RunAsync has cognitive complexity 64 (threshold 15). Of this number, 45 points are the body's own statements and 19 belong to 17 function literals inside it that branch. 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.
RoslynTestQualityCollector.AnalyzeRoot (cognitive 63) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:552— RoslynTestQualityCollector.AnalyzeRoot has cognitive complexity 63 (threshold 15). Of this number, 62 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeDecayModel.Build (cognitive 63) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeDecayModel.cs:208— KnowledgeDecayModel.Build has cognitive complexity 63 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KnowledgeFreshnessAnalyzer.RunAsync (cognitive 63) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeFreshnessAnalyzer.cs:81— KnowledgeFreshnessAnalyzer.RunAsync has cognitive complexity 63 (threshold 15). Of this number, 62 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check.main (cognitive 63) engine/sidecars/kotlin-frontend/selftest/check.py:31— check.main has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (28 pts), boolean chains 26, loops 4 (5 pts), ternaries 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FrontendTestSuiteMasking.CollectFromBenchmarkTree (cognitive 62) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:11— FrontendTestSuiteMasking.CollectFromBenchmarkTree has cognitive complexity 62 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BuildTopLevelBindingMask (cognitive 62) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:198— JsDuplicationDetector.BuildTopLevelBindingMask has cognitive complexity 62 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MinifiedJsHeuristics.StripStringsAndComments (cognitive 62) engine/src/CodeHealth.Core/Frontend/MinifiedJsHeuristics.cs:251— MinifiedJsHeuristics.StripStringsAndComments has cognitive complexity 62 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.SecurityAndPerf (cognitive 62) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4675— ProductionReadinessAnalyzer.SecurityAndPerf has cognitive complexity 62 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
VacuousFormatGate.CommandPositions (cognitive 62) engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:270— VacuousFormatGate.CommandPositions has cognitive complexity 62 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsScopeBindings.Build (cognitive 61) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:354— JsScopeBindings.Build has cognitive complexity 61 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.AnemicDomainModel (cognitive 61) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2379— DomainModelAnalyzer.AnemicDomainModel has cognitive complexity 61 (threshold 15). Of this number, 49 points are the body's own statements and 12 belong to 12 function literals inside it that branch. 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.
CSharpTokenizer.TokenizeLine (cognitive 61) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:80— CSharpTokenizer.TokenizeLine has cognitive complexity 61 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.MovingCargoGitDependencies (cognitive 61) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1470— SupplyChainProvenanceAnalyzer.MovingCargoGitDependencies has cognitive complexity 61 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render.render (cognitive 61) docs/marketing/whitepapers/render.py:117— render.render has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 6 (16 pts), ternaries 3 (10 pts), boolean chains 7 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-calibration.cmd_judge (cognitive 61) tools/train/judge-calibration.py:717— judge-calibration.cmd_judge has cognitive complexity 61 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 18, ternaries 3 (5 pts), error handling 2 (3 pts), loops 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.Analyze (cognitive 60) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:81— AccessibilityAnalyzer.Analyze has cognitive complexity 60 (threshold 15). Of this number, 58 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
AccessibilityAnalyzer.FormsAndLabels (cognitive 60) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2246— AccessibilityAnalyzer.FormsAndLabels has cognitive complexity 60 (threshold 15). Of this number, 58 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.WorkflowSteps (cognitive 60) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6850— SupplyChainProvenanceAnalyzer.WorkflowSteps has cognitive complexity 60 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FSharpProvider.CreateMany (cognitive 60) engine/src/CodeHealth.CodeModel.FSharp/FSharpProvider.fs:174— FSharpProvider.CreateMany has cognitive complexity 60 (threshold 15). Drivers by points: if/else 10 (26 pts), loops 5 (15 pts), match/switch 5 (14 pts), error handling 1 (4 pts), boolean chains 1 (nesting depth added 38). 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.
programme-status.heldout_report (cognitive 60) tools/train/programme-status.py:454— programme-status.heldout_report has cognitive complexity 60 (threshold 15). Drivers by points: if/else 15 (34 pts), ternaries 5 (17 pts), boolean chains 7, loops 2 (nesting depth added 31). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FrontendEmittedTemplateRefs.CollectBundleEntries (cognitive 59) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:230— FrontendEmittedTemplateRefs.CollectBundleEntries has cognitive complexity 59 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.OutboxDualWrite (cognitive 59) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:645— EventDrivenAnalyzer.OutboxDualWrite has cognitive complexity 59 (threshold 15). Of this number, 52 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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.
ProductionReadinessAnalyzer.DisasterRecovery (cognitive 59) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:1889— ProductionReadinessAnalyzer.DisasterRecovery has cognitive complexity 59 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DotnetTestReliabilityCollector.CollectAsync (cognitive 59) engine/src/CodeHealth.Core/Testing/DotnetTestReliabilityCollector.cs:30— DotnetTestReliabilityCollector.CollectAsync has cognitive complexity 59 (threshold 15). Of this number, 58 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoTestCensus.Strip (cognitive 59) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:232— GoTestCensus.Strip has cognitive complexity 59 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.OsvFindings (cognitive 59) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1417— ScanParsers.OsvFindings has cognitive complexity 59 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer.blankLiterals (cognitive 59) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Tokenizer.scala:146— Tokenizer.blankLiterals has cognitive complexity 59 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 5 (17 pts), boolean chains 6 (nesting depth added 34). 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.
ReportViewModelFactory.Build (cognitive 58) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:64— ReportViewModelFactory.Build has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.JobsGrantingWriteBeyondGatedSteps (cognitive 58) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7630— SupplyChainProvenanceAnalyzer.JobsGrantingWriteBeyondGatedSteps has cognitive complexity 58 (threshold 15). Of this number, 55 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
TestDistributionAnalyzer.RunAsync (cognitive 58) engine/src/CodeHealth.Dimensions.Testing/TestDistributionAnalyzer.cs:21— TestDistributionAnalyzer.RunAsync has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
baseline.main (cognitive 58) tools/multilang/baseline.py:241— baseline.main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (41 pts), loops 4 (11 pts), ternaries 3 (5 pts), boolean chains 1 (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.
prove-gap-channel-separation.main (cognitive 58) tools/train/prove-gap-channel-separation.py:42— prove-gap-channel-separation.main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 11 (33 pts), loops 8 (22 pts), boolean chains 3 (nesting depth added 36). 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.
FrontendModuleGraph.CircularGroups (cognitive 57) engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:624— FrontendModuleGraph.CircularGroups has cognitive complexity 57 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AppKindDetector.DetectAsync (cognitive 57) engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs:14— AppKindDetector.DetectAsync has cognitive complexity 57 (threshold 15). Of this number, 55 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
EventDrivenAnalyzer.AnalyzeAsync (cognitive 57) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:72— EventDrivenAnalyzer.AnalyzeAsync has cognitive complexity 57 (threshold 15). Of this number, 55 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
arm-state.main (cognitive 57) tools/train/arm-state.py:38— arm-state.main has cognitive complexity 57 (threshold 15). Drivers by points: if/else 9 (21 pts), ternaries 7 (19 pts), boolean chains 7, loops 4 (7 pts), error handling 1 (3 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.
CyclomaticComplexityCalculator.ComputeAsync (cognitive 56) engine/src/CodeHealth.Core/Complexity/CyclomaticComplexityCalculator.cs:32— CyclomaticComplexityCalculator.ComputeAsync has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.CollectUnlisted (cognitive 56) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:2010— FrontendDependencyHygiene.CollectUnlisted has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndentedMarkupProducer.ParseAttributes (cognitive 56) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:586— IndentedMarkupProducer.ParseAttributes has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GdprPersonalDataAnalyzer.AnalyzeAsync (cognitive 56) engine/src/CodeHealth.Core/ModelAware/GdprPersonalDataAnalyzer.cs:70— GdprPersonalDataAnalyzer.AnalyzeAsync has cognitive complexity 56 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SolutionShapeAnalyzer.RunAsync (cognitive 56) engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:82— SolutionShapeAnalyzer.RunAsync has cognitive complexity 56 (threshold 15). Of this number, 55 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ScanParsers.SiblingAdvisoryFloors (cognitive 56) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1197— ScanParsers.SiblingAdvisoryFloors has cognitive complexity 56 (threshold 15). Of this number, 50 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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.
check.main (cognitive 56) engine/sidecars/python-frontend/selftest/check.py:36— check.main has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (25 pts), boolean chains 17, ternaries 8 (9 pts), error handling 3, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RoslynExplicitDebtCollector.CollectWriteOnlyPrivateFields (cognitive 55) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1310— RoslynExplicitDebtCollector.CollectWriteOnlyPrivateFields has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynTestQualityCollector.CollectAsync (cognitive 55) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:153— RoslynTestQualityCollector.CollectAsync has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ActionArgvCommandLines (cognitive 55) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9606— SupplyChainProvenanceAnalyzer.ActionArgvCommandLines has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gold-draw.cmd_verify (cognitive 55) tools/train/gold-draw.py:275— gold-draw.cmd_verify has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 10, loops 3 (6 pts), ternaries 4 (6 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanSyntax (cognitive 54) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1164— ComplianceSecurityAnalyzer.ScanSyntax has cognitive complexity 54 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendAnalyzer.Analyze (cognitive 54) engine/src/CodeHealth.Core/Discovery/FrontendAnalyzer.cs:196— FrontendAnalyzer.Analyze has cognitive complexity 54 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UnverifiedBinaryIngests (cognitive 54) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1116— SupplyChainProvenanceAnalyzer.UnverifiedBinaryIngests has cognitive complexity 54 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agg_scala_dm6.main (cognitive 54) tools/multilang/agg_scala_dm6.py:46— agg_scala_dm6.main has cognitive complexity 54 (threshold 15). Drivers by points: if/else 12 (28 pts), boolean chains 9, ternaries 5 (9 pts), loops 5 (8 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-viability-by-dimension.main (cognitive 54) tools/train/judge-viability-by-dimension.py:72— judge-viability-by-dimension.main has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 9 (12 pts), ternaries 4 (9 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.
branchWalker.stmt (cognitive 54) engine/sidecars/go/bodybranch.go:94— branchWalker.stmt has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (32 pts), loops 7 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 30). 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.
ChainedCorrespondence.Aggregate (cognitive 53) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:79— ChainedCorrespondence.Aggregate has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.Detect (cognitive 53) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2405— JsDuplicationDetector.Detect has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.ExtendRunsThroughSupersetRelations (cognitive 53) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5923— JsDuplicationDetector.ExtendRunsThroughSupersetRelations has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.Classify (cognitive 53) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:989— IncompletenessAnalyzer.Classify has cognitive complexity 53 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.WorkflowTokenHygiene (cognitive 53) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8699— SupplyChainProvenanceAnalyzer.WorkflowTokenHygiene has cognitive complexity 53 (threshold 15). Of this number, 47 points are the body's own statements and 6 belong to 8 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
check.main (cognitive 53) engine/sidecars/ruby-frontend/selftest/check.mjs:47— check.main has cognitive complexity 53 (threshold 15). Drivers by points: boolean chains 51, if/else 1, ternaries 1. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CSharpSourceScanner.Tokenize (cognitive 52) engine/src/CodeHealth.Core/ApiSurface/CSharpSourceScanner.cs:33— CSharpSourceScanner.Tokenize has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Tokenizer.blankLiterals (cognitive 52) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Tokenizer.kt:174— Tokenizer.blankLiterals has cognitive complexity 52 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 4 (13 pts), boolean chains 6 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BranchWalker._stmt (cognitive 52) engine/sidecars/python-frontend/bodyfacts.py:51— BranchWalker._stmt has cognitive complexity 52 (threshold 15). Drivers by points: loops 14 (34 pts), if/else 11 (17 pts), boolean chains 1 (nesting depth added 26). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ArchitectureMapBuilder.BuildAsync (cognitive 51) engine/src/CodeHealth.Core/Architecture/ArchitectureMapBuilder.cs:43— ArchitectureMapBuilder.BuildAsync has cognitive complexity 51 (threshold 15). Of this number, 50 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndirectionAnalyzer.AnalyzeAsync (cognitive 51) engine/src/CodeHealth.Core/Architecture/IndirectionAnalyzer.cs:314— IndirectionAnalyzer.AnalyzeAsync has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.AnalyzeAsync (cognitive 51) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:424— ComplianceSecurityAnalyzer.AnalyzeAsync has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PnpmLockfileReader.ReadDirectProduction (cognitive 51) engine/src/CodeHealth.Core/Dependencies/PnpmLockfileReader.cs:48— PnpmLockfileReader.ReadDirectProduction has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureModelAnalyzer.SliceCohesion (cognitive 51) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2008— ArchitectureModelAnalyzer.SliceCohesion has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.IntegrationEventCoupling (cognitive 51) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2266— DomainModelAnalyzer.IntegrationEventCoupling has cognitive complexity 51 (threshold 15). Of this number, 48 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
JsInteropContractAnalyzer.AnalyzeAsync (cognitive 51) engine/src/CodeHealth.Core/ModelAware/JsInteropContractAnalyzer.cs:33— JsInteropContractAnalyzer.AnalyzeAsync has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChurnCommitIdentity.CountedChanges (cognitive 51) engine/src/CodeHealth.Toolchain/Git/ChurnCommitIdentity.cs:39— ChurnCommitIdentity.CountedChanges has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.GuardRegionOf (cognitive 51) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2994— DuplicationAnalyzer.GuardRegionOf has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.PrTriggeredWorkflowsGrantingWrite (cognitive 51) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7795— SupplyChainProvenanceAnalyzer.PrTriggeredWorkflowsGrantingWrite has cognitive complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
SupplyChainProvenanceAnalyzer.AdvisoryMonitoringFor (cognitive 51) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10185— SupplyChainProvenanceAnalyzer.AdvisoryMonitoringFor has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.TokenAuthedNpmPublishes (cognitive 51) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.NpmRegistryAuth.cs:176— SupplyChainProvenanceAnalyzer.TokenAuthedNpmPublishes has cognitive complexity 51 (threshold 15). Of this number, 49 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.ScanExportDeclaration (cognitive 50) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:956— ModuleSyntaxScanner.ScanExportDeclaration has cognitive complexity 50 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.ArchitectureDocs (cognitive 50) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:678— MaturityAnalyzer.ArchitectureDocs has cognitive complexity 50 (threshold 15). Of this number, 43 points are the body's own statements and 7 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AggregateTransactionAnalyzer.Analyze (cognitive 50) engine/src/CodeHealth.Core/ModelAware/AggregateTransactionAnalyzer.cs:67— AggregateTransactionAnalyzer.Analyze has cognitive complexity 50 (threshold 15). Of this number, 49 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.IndexMethods (cognitive 50) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:632— FileModel.IndexMethods has cognitive complexity 50 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.ScanImportStatement (cognitive 49) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:668— ModuleSyntaxScanner.ScanImportStatement has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OperabilityExtrasAnalyzer.AnalyzeAsync (cognitive 49) engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:21— OperabilityExtrasAnalyzer.AnalyzeAsync has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsTestCensus.Strip (cognitive 49) engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:163— JsTestCensus.Strip has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.RequiredStatusContexts (cognitive 49) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10655— SupplyChainProvenanceAnalyzer.RequiredStatusContexts has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge_assignment.census_failures (cognitive 49) tools/train/judge_assignment.py:1483— judge_assignment.census_failures has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (33 pts), boolean chains 13, loops 2, ternaries 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.
NeutralFileLengthScanner.CountBraces (cognitive 48) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:721— NeutralFileLengthScanner.CountBraces has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BundlerManifestHygiene.Read (cognitive 48) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:90— BundlerManifestHygiene.Read has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.DirectoryBarrelReached (cognitive 48) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:2132— FrontendTestReachability.DirectoryBarrelReached has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsprojReferenceGraph.ImportedMsBuildTexts (cognitive 48) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:492— CsprojReferenceGraph.ImportedMsBuildTexts has cognitive complexity 48 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DomainModelAnalyzer.AggregateBoundaries (cognitive 48) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1930— DomainModelAnalyzer.AggregateBoundaries has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchGraphSvg.RenderClustered (cognitive 48) engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:124— ArchGraphSvg.RenderClustered has cognitive complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
NamelessWorkloadNormalisedScan.Normalise (cognitive 48) engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadNormalisedScan.cs:222— NamelessWorkloadNormalisedScan.Normalise has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
memberEmitters (cognitive 48) engine/sidecars/tsjs-frontend/extract-file.mjs:100— memberEmitters has cognitive complexity 48 (threshold 15). Drivers by points: ternaries 16, if/else 13 (15 pts), other 8, boolean chains 7, error handling 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 0 of the 48 points are its own statements and the rest belongs to 11 function items inside it that branch (typeRefOfNode, emitAccessor, emitMember, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
BundlerManifestHygiene.ParseDeclarations (cognitive 47) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:623— BundlerManifestHygiene.ParseDeclarations has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.ScanCommentTypeImports (cognitive 47) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:78— ModuleSyntaxScanner.ScanCommentTypeImports has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupTaintPass.CollectHoles (cognitive 47) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:681— MarkupTaintPass.CollectHoles has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleRecommendationEngine.ForDimension (cognitive 47) engine/src/CodeHealth.Reporting/Recommendations/RuleRecommendationEngine.cs:325— RuleRecommendationEngine.ForDimension has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.DuplicationRemediationCore (cognitive 47) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1546— DuplicationAnalyzer.DuplicationRemediationCore has cognitive complexity 47 (threshold 15). Of this number, 40 points are the body's own statements and 7 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RubyArgumentMutatedScan.ParametersOf (cognitive 47) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:264— RubyArgumentMutatedScan.ParametersOf has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControlFlowComplexity.CognitiveShape (cognitive 46) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:274— ControlFlowComplexity.CognitiveShape has cognitive complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
FrontendBundlerConfigRefs.CollectBundlerAliases (cognitive 46) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:586— FrontendBundlerConfigRefs.CollectBundlerAliases has cognitive complexity 46 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.MutableEntities (cognitive 46) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3324— DomainModelAnalyzer.MutableEntities has cognitive complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ScanParsers.OsvNuGetFixVersions (cognitive 46) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1607— ScanParsers.OsvNuGetFixVersions has cognitive complexity 46 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scope-evidence.evidence_for (cognitive 46) tools/train/scope-evidence.py:620— scope-evidence.evidence_for has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 14, ternaries 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.PackageNameReached (cognitive 45) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:966— FrontendTestReachability.PackageNameReached has cognitive complexity 45 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventSourcingAnalyzer.PiiInEventStore (cognitive 45) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1128— EventSourcingAnalyzer.PiiInEventStore has cognitive complexity 45 (threshold 15). Of this number, 43 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
SupplyChainHygieneAnalyzer.Analyze (cognitive 45) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:355— SupplyChainHygieneAnalyzer.Analyze has cognitive complexity 45 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ComposeServiceSurface.ServicesIn (cognitive 45) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:114— ComposeServiceSurface.ServicesIn has cognitive complexity 45 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
adjudication.audit_rounds (cognitive 45) tools/train/adjudication.py:256— adjudication.audit_rounds has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 5 (9 pts), error handling 1 (3 pts), boolean chains 2, ternaries 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence-ab.main (cognitive 45) tools/train/evidence-ab.py:298— evidence-ab.main has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (28 pts), loops 6 (9 pts), boolean chains 5, ternaries 1 (2 pts), error handling 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectInvertedNullGuards (cognitive 44) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:868— RoslynExplicitDebtCollector.CollectInvertedNullGuards has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.CandidateBinNames (cognitive 44) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1541— FrontendDependencyHygiene.CandidateBinNames has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.Documentation (cognitive 44) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:409— MaturityAnalyzer.Documentation has cognitive complexity 44 (threshold 15). Of this number, 42 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
AccessibilityAnalyzer.KeyboardSemantics (cognitive 44) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:3353— AccessibilityAnalyzer.KeyboardSemantics has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.AnalyzeAsync (cognitive 44) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:84— DomainModelAnalyzer.AnalyzeAsync has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SecretsHistoryAnalyzer.CountBraceDelta (cognitive 44) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1537— SecretsHistoryAnalyzer.CountBraceDelta has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compare.main (cognitive 44) tools/multilang/compare.py:46— compare.main has cognitive complexity 44 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 11 (17 pts), boolean chains 4, ternaries 4 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scope-evidence.value_provenance_evidence (cognitive 44) tools/train/scope-evidence.py:427— scope-evidence.value_provenance_evidence has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 6 (12 pts), boolean chains 5 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ts-helpers.callsOf (cognitive 44) engine/sidecars/tsjs-frontend/ts-helpers.mjs:506— ts-helpers.callsOf has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (18 pts), ternaries 7 (13 pts), boolean chains 8, error handling 3 (4 pts), loops 1 (nesting depth added 11). Most of this is not in the body itself: 2 of the 44 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 539, 514, 553, …). 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.
ComplianceSecurityAnalyzer.ScanCryptoStreamModeContradiction (cognitive 43) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2622— ComplianceSecurityAnalyzer.ScanCryptoStreamModeContradiction has cognitive complexity 43 (threshold 15). Of this number, 42 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MixManifestHygiene.Read (cognitive 43) engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:68— MixManifestHygiene.Read has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.DetectEditedCopies (cognitive 43) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4902— JsDuplicationDetector.DetectEditedCopies has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainConventions.ClassifyHandler (cognitive 43) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1634— DomainConventions.ClassifyHandler has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.Cicd (cognitive 43) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3435— ProductionReadinessAnalyzer.Cicd has cognitive complexity 43 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DuplicationAnalyzer.DivergentTypeBindingCaveat (cognitive 43) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1800— DuplicationAnalyzer.DivergentTypeBindingCaveat has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneSpanShape.Of (cognitive 43) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4123— CloneSpanShape.Of has cognitive complexity 43 (threshold 15). Of this number, 40 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.DependencyDetail (cognitive 43) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2102— ScanParsers.DependencyDetail has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.MovingPythonGitDependencies (cognitive 43) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1820— SupplyChainProvenanceAnalyzer.MovingPythonGitDependencies has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.SoftFailedGatesBeforePublish (cognitive 43) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2213— SupplyChainProvenanceAnalyzer.SoftFailedGatesBeforePublish has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.HasExplicitDependency (cognitive 43) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3346— ChangeCouplingAnalyzer.HasExplicitDependency has cognitive complexity 43 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
JvmProvider.Build (cognitive 43) engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:450— JvmProvider.Build has cognitive complexity 43 (threshold 15). Of this number, 42 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Check.run (cognitive 43) engine/sidecars/elixir-frontend/selftest/check.exs:22— Check.run has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 41, if/else 1, match/switch 1. 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.
Extractor.collectMember (cognitive 43) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Extractor.swift:145— Extractor.collectMember has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (26 pts), loops 4 (10 pts), boolean chains 7 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
collectModuleUnits (cognitive 43) engine/sidecars/tsjs-frontend/extract-file.mjs:11— collectModuleUnits has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 14, loops 5 (7 pts), ternaries 3, other 2 (nesting depth added 9). Most of this is not in the body itself: 13 of the 43 points are its own statements and the rest belongs to 8 function items inside it that branch (unwrapCall, carriedByLogical, insideTypeCarrier, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MemberPairRollup.Aggregate (cognitive 42) engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:74— MemberPairRollup.Aggregate has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineLexer.CodeOnly (cognitive 42) engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:235— LineLexer.CodeOnly has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lcom4Calculator.ComputeAsync (cognitive 42) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:26— Lcom4Calculator.ComputeAsync has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDeadCodeDetector.DetectAsync (cognitive 42) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:110— RoslynDeadCodeDetector.DetectAsync has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBundlerConfigRefs.CollectJsonBuildManifestEntries (cognitive 42) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1161— FrontendBundlerConfigRefs.CollectJsonBuildManifestEntries has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.IsRegistrationDataModule (cognitive 42) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1492— FrontendTestReachability.IsRegistrationDataModule has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsComplexity.FindBracelessBodyEnd (cognitive 42) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:497— JsComplexity.FindBracelessBodyEnd has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventSourcingAnalyzer.PiiInEventStore (cognitive 42) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:421— EventSourcingAnalyzer.PiiInEventStore has cognitive complexity 42 (threshold 15). Of this number, 41 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepoProfiler.DetectDdd (cognitive 42) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:308— RepoProfiler.DetectDdd has cognitive complexity 42 (threshold 15). Of this number, 34 points are the body's own statements and 8 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CommittedCoverageReader.ParseSimpleCovJson (cognitive 42) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:726— CommittedCoverageReader.ParseSimpleCovJson has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GodClassAnalyzer.RunAsync (cognitive 42) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:25— GodClassAnalyzer.RunAsync has cognitive complexity 42 (threshold 15). Of this number, 37 points are the body's own statements and 5 belong to 5 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ChangeCouplingAnalyzer.RustVariantsOf (cognitive 42) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4142— ChangeCouplingAnalyzer.RustVariantsOf has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
corpus_gitlab.discover (cognitive 42) tools/multilang/corpus_gitlab.py:89— corpus_gitlab.discover has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (27 pts), boolean chains 12, loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
report_detection_delta.validate (cognitive 42) tools/train/report_detection_delta.py:294— report_detection_delta.validate has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 5 (8 pts), boolean chains 7, ternaries 1 (4 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.
(anonymous) (cognitive 42) src/Kennel.Ui/wwwroot/kennel-ui.js:1600— (anonymous) has cognitive complexity 42 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 7, ternaries 3, error handling 1, loops 1 (nesting depth added 6). Most of this is not in the body itself: 3 of the 42 points are its own statements and the rest belongs to 17 function items inside it that branch (wire::load, renderMd, wire, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SourceClassifier.IsTestPath (cognitive 41) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:67— SourceClassifier.IsTestPath has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PolyglotConditionScanner.BlankNonCode (cognitive 41) engine/src/CodeHealth.Core/CodeShape/PolyglotConditionScanner.cs:322— PolyglotConditionScanner.BlankNonCode has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuotedTextMask.MaskStringLiteral (cognitive 41) engine/src/CodeHealth.Core/CodeShape/QuotedTextMask.cs:208— QuotedTextMask.MaskStringLiteral has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEngineDimensions.DeadCodeDimension (cognitive 41) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:622— FrontendEngineDimensions.DeadCodeDimension has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.MergeNearCloneExtents (cognitive 41) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4099— JsDuplicationDetector.MergeNearCloneExtents has cognitive complexity 41 (threshold 15). Of this number, 39 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CountIndentationTemplateTags (cognitive 41) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:313— AccessibilityAnalyzer.CountIndentationTemplateTags has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureModelAnalyzer.SliceCohesion (cognitive 41) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:455— ArchitectureModelAnalyzer.SliceCohesion has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.RepositoryPerAggregateRoot (cognitive 41) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4981— DomainModelAnalyzer.RepositoryPerAggregateRoot has cognitive complexity 41 (threshold 15). Of this number, 38 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
ReportViewModelFactory.BuildArchGraphCore (cognitive 41) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:2506— ReportViewModelFactory.BuildArchGraphCore has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IlMetricsExtractor.Extract (cognitive 41) engine/src/CodeHealth.Dimensions.CodeQuality/Il/IlMetricsExtractor.cs:72— IlMetricsExtractor.Extract has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.ParsePyProject (cognitive 41) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1933— DeclaredDependencies.ParsePyProject has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellExecRecheck.RubyCallArguments (cognitive 41) engine/src/CodeHealth.Dimensions.Security/Scanners/ShellExecRecheck.cs:683— ShellExecRecheck.RubyCallArguments has cognitive complexity 41 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.RunAsync (cognitive 41) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:66— ChangeCouplingAnalyzer.RunAsync has cognitive complexity 41 (threshold 15). Of this number, 32 points are the body's own statements and 9 belong to 9 function literals inside it that branch. 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.
branchWalker.stmtOpaque (cognitive 41) engine/sidecars/go/bodybranch.go:311— branchWalker.stmtOpaque has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (18 pts), match/switch 1 (nesting depth added 25). 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.
ChainedFamilyRollup.Cluster (cognitive 40) engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:229— ChainedFamilyRollup.Cluster has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.C2 (cognitive 40) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5123— ComplianceSecurityAnalyzer.C2 has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendManifestEntryPoints.CollectRegistryManifestFiles (cognitive 40) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:138— FrontendManifestEntryPoints.CollectRegistryManifestFiles has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestAndDocRefs.CollectTestIncludeGlobs (cognitive 40) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:71— FrontendTestAndDocRefs.CollectTestIncludeGlobs has cognitive complexity 40 (threshold 15). Of this number, 39 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndentedMarkupProducer.TryParseTag (cognitive 40) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:366— IndentedMarkupProducer.TryParseTag has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupParser.Build (cognitive 40) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:52— MarkupParser.Build has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.TextAlternatives (cognitive 40) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:959— AccessibilityAnalyzer.TextAlternatives has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.DeploymentRollback (cognitive 40) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:993— ProductionReadinessAnalyzer.DeploymentRollback has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RunLimitations.BuildFailures (cognitive 40) engine/src/CodeHealth.Reporting/Limitations/RunLimitations.cs:104— RunLimitations.BuildFailures has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneSpanShape.Scrub (cognitive 40) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4604— CloneSpanShape.Scrub has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lint_hardcode.main (cognitive 40) tools/multilang/lint_hardcode.py:31— lint_hardcode.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (13 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gold-draw.cmd_coverage (cognitive 40) tools/train/gold-draw.py:113— gold-draw.cmd_coverage has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 5 (7 pts), ternaries 3 (7 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
gold-draw.cmd_draw (cognitive 40) tools/train/gold-draw.py:179— gold-draw.cmd_draw has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 7 (9 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run-arms.main (cognitive 40) tools/train/run-arms.py:72— run-arms.main has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (20 pts), ternaries 3 (11 pts), loops 4 (8 pts), boolean chains 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.
QuotedTextMask.Mask (cognitive 39) engine/src/CodeHealth.Core/CodeShape/QuotedTextMask.cs:144— QuotedTextMask.Mask has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectAsync (cognitive 39) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:30— RoslynExplicitDebtCollector.CollectAsync has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.DetectFrameworkConventions (cognitive 39) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:540— EntryPointCatalog.DetectFrameworkConventions has cognitive complexity 39 (threshold 15). 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.
FrontendConfigResolution.ParseTsConfigRaw (cognitive 39) engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:248— FrontendConfigResolution.ParseTsConfigRaw has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.CollectToolCommandTokens (cognitive 39) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:424— FrontendScriptCommandRefs.CollectToolCommandTokens has cognitive complexity 39 (threshold 15). Of this number, 38 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.Coalesce (cognitive 39) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6748— JsDuplicationDetector.Coalesce has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsScopeBindings.BindDeclarators (cognitive 39) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:668— JsScopeBindings.BindDeclarators has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndentedMarkupProducer.Read (cognitive 39) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:131— IndentedMarkupProducer.Read has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsTestQualityCensus.Collect (cognitive 39) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:80— JsTestQualityCensus.Collect has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileExtractor.classLike (cognitive 39) engine/sidecars/php-frontend/main.php:307— FileExtractor.classLike has cognitive complexity 39 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (13 pts), boolean chains 9, ternaries 3 (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.
SwiftPackageHygiene.Read (cognitive 38) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:81— SwiftPackageHygiene.Read has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.SliceComponents (cognitive 38) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:424— FrontendBoundaries.SliceComponents has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.IsClassHeaderClose (cognitive 38) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:175— JsFunctionScanner.IsClassHeaderClose has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralScatteredDerivation.Find (cognitive 38) engine/src/CodeHealth.Core/ModelAware/NeutralScatteredDerivation.cs:56— NeutralScatteredDerivation.Find has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeterminismGuard.Evaluate (cognitive 38) engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/DeterminismGuard.cs:15— DeterminismGuard.Evaluate has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskSourceFiles.WeighUnreadLanguagesAsync (cognitive 38) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:861— DiskSourceFiles.WeighUnreadLanguagesAsync has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.IsNoisyPath (cognitive 38) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3867— SecretNoiseFilter.IsNoisyPath has cognitive complexity 38 (threshold 15). 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.
CSharpTokenizer.ReadStringLiteral (cognitive 38) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:238— CSharpTokenizer.ReadStringLiteral has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.PushTriggerFilters (cognitive 38) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7233— SupplyChainProvenanceAnalyzer.PushTriggerFilters has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-calibration.cmd_extract (cognitive 38) tools/train/judge-calibration.py:413— judge-calibration.cmd_extract has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (9 pts), boolean chains 8, ternaries 2 (8 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDuplicationDetector.AppendCopiedFileClones (cognitive 37) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1324— RoslynDuplicationDetector.AppendCopiedFileClones has cognitive complexity 37 (threshold 15). Of this number, 36 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VbGodClassScanner.ScanAsync (cognitive 37) engine/src/CodeHealth.Core/CodeShape/VbGodClassScanner.cs:19— VbGodClassScanner.ScanAsync has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectSerializedSecretLogging (cognitive 37) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1610— ComplianceSecurityAnalyzer.DetectSerializedSecretLogging has cognitive complexity 37 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
InactivePreprocessorReferenceScanner.CollectAsync (cognitive 37) engine/src/CodeHealth.Core/ExplicitDebt/InactivePreprocessorReferenceScanner.cs:63— InactivePreprocessorReferenceScanner.CollectAsync has cognitive complexity 37 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FrontendBoundaries.CollectFsdViolations (cognitive 37) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:768— FrontendBoundaries.CollectFsdViolations has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectTestTreeCrossPackageViolations (cognitive 37) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1401— FrontendBoundaries.CollectTestTreeCrossPackageViolations has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEmittedTemplateRefs.CollectGeneratedModuleEmitters (cognitive 37) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:124— FrontendEmittedTemplateRefs.CollectGeneratedModuleEmitters has cognitive complexity 37 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendEngineDimensions.CloneRemediation (cognitive 37) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:1477— FrontendEngineDimensions.CloneRemediation has cognitive complexity 37 (threshold 15). Of this number, 35 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BuildImportMask (cognitive 37) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6932— JsDuplicationDetector.BuildImportMask has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.ScanMember (cognitive 37) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:429— JsFunctionScanner.ScanMember has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainConventions.ClassifyHandler (cognitive 37) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:287— DomainConventions.ClassifyHandler has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.NpmWorkspacePatterns (cognitive 37) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:4107— SupplyChainProvenanceAnalyzer.NpmWorkspacePatterns has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
status.main (cognitive 37) tools/llm-bakeoff/status.py:66— status.main has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 6 (7 pts), boolean chains 5, ternaries 1 (2 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.
scan.run_contained (cognitive 37) tools/multilang/scan.py:361— scan.run_contained has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (19 pts), ternaries 4 (14 pts), boolean chains 4 (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.
main.Scan (cognitive 37) engine/sidecars/go/scan.go:18— main.Scan has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 4 (5 pts) (nesting depth added 17). Most of this is not in the body itself: 11 of the 37 points are its own statements and the rest belongs to one function literal inside it that branches (line 50). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
NeutralFileLengthScanner.LiteralFreeSkeleton (cognitive 36) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1075— NeutralFileLengthScanner.LiteralFreeSkeleton has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CyclomaticComplexityCalculator.AddModelMethods (cognitive 36) engine/src/CodeHealth.Core/Complexity/CyclomaticComplexityCalculator.cs:208— CyclomaticComplexityCalculator.AddModelMethods has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.ForeignBrowserSuiteReached (cognitive 36) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1945— FrontendTestReachability.ForeignBrowserSuiteReached has cognitive complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.PageLevelChecks (cognitive 36) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2971— AccessibilityAnalyzer.PageLevelChecks has cognitive complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to 4 function literals inside it that branch. 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.
CoherenceSmellAnalyzer.ScanSubsumedOperands (cognitive 36) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:123— CoherenceSmellAnalyzer.ScanSubsumedOperands has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PerformanceAnalyzer.CollectAsync (cognitive 36) engine/src/CodeHealth.Core/ModelAware/PerformanceAnalyzer.cs:311— PerformanceAnalyzer.CollectAsync has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.VbaTestSourceExtensions (cognitive 36) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:584— DiskTestScanner.VbaTestSourceExtensions has cognitive complexity 36 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DuplicationAnalyzer.GuardAsymmetryCaveat (cognitive 36) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2847— DuplicationAnalyzer.GuardAsymmetryCaveat has cognitive complexity 36 (threshold 15). Of this number, 35 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigCredentialBindingScan.FindingsInFile (cognitive 36) engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:275— ConfigCredentialBindingScan.FindingsInFile has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmLockGraph.NpmLockGraph.ctor (cognitive 36) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:72— NpmLockGraph.NpmLockGraph.ctor has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedRemoteInstallerScan.FetchesDigestFromAnArtefactOrigin (cognitive 36) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:397— UnverifiedRemoteInstallerScan.FetchesDigestFromAnArtefactOrigin has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelBuilder.WireTypes (cognitive 36) engine/src/CodeHealth.CodeModel.Jvm/Builder.cs:125— ModelBuilder.WireTypes has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelBuilder.WrapEntity (cognitive 36) engine/src/CodeHealth.CodeModel.FSharp/Builder.fs:214— ModelBuilder.WrapEntity has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (20 pts), error handling 5 (10 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
verify-documentation-paths.main (cognitive 36) deploy/verify-documentation-paths.py:269— verify-documentation-paths.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 4 (5 pts), ternaries 2 (4 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rehearse_verification.main (cognitive 36) tools/train/rehearse_verification.py:314— rehearse_verification.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 8, loops 2 (3 pts), ternaries 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.
reuse-safety.main (cognitive 36) tools/train/reuse-safety.py:97— reuse-safety.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (17 pts), ternaries 4 (12 pts), loops 4 (7 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract-file.extractFile (cognitive 36) engine/sidecars/tsjs-frontend/extract-file.mjs:427— extract-file.extractFile has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12, boolean chains 11, ternaries 5 (9 pts), loops 2 (4 pts) (nesting depth added 6). Most of this is not in the body itself: 9 of the 36 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 492, 502, 447, …). 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.
LineBasedGodClassDetector.ContractRepeatedMemberSurplus (cognitive 35) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:718— LineBasedGodClassDetector.ContractRepeatedMemberSurplus has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.DetectTests (cognitive 35) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:787— EntryPointCatalog.DetectTests has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportUsageSolver.SeedDirectImports (cognitive 35) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:2016— ExportUsageSolver.SeedDirectImports has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEmittedTemplateRefs.ResolveEmittedTemplateFamilyAgainst (cognitive 35) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:383— FrontendEmittedTemplateRefs.ResolveEmittedTemplateFamilyAgainst has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.CollectLockfileBinNames (cognitive 35) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:748— FrontendScriptCommandRefs.CollectLockfileBinNames has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsConstantOnlyField.IsExported (cognitive 35) engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:364— JsConstantOnlyField.IsExported has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsScopeBindings.FunctionBodyParams (cognitive 35) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:505— JsScopeBindings.FunctionBodyParams has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.InspectDisposalDuties (cognitive 35) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:1165— LogicDefectAnalyzer.InspectDisposalDuties has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DartAnalyzerExclusions.Inspect (cognitive 35) engine/src/CodeHealth.Core/Readiness/DartAnalyzerExclusions.cs:86— DartAnalyzerExclusions.Inspect has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.ReleaseHygiene (cognitive 35) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2546— ProductionReadinessAnalyzer.ReleaseHygiene has cognitive complexity 35 (threshold 15). 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.
CommittedCoverageReader.MergeSimpleCovJsonPerFile (cognitive 35) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1299— CommittedCoverageReader.MergeSimpleCovJsonPerFile has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeTestReliabilityCollector.ParseJestShaped (cognitive 35) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:535— NodeTestReliabilityCollector.ParseJestShaped has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitIdentityGraph.Build (cognitive 35) engine/src/CodeHealth.Toolchain/Git/CommitIdentityGraph.cs:62— CommitIdentityGraph.Build has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangelogNarrator.DescribeAsync (cognitive 35) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:201— ChangelogNarrator.DescribeAsync has cognitive complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.ExtractionCaveat (cognitive 35) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3533— DuplicationAnalyzer.ExtractionCaveat has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.IsChecksumLiteralElementBinding (cognitive 35) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:1133— SecretNoiseFilter.IsChecksumLiteralElementBinding has cognitive complexity 35 (threshold 15). Of this number, 33 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
UnverifiedRemoteInstallerScan.ExtractedAndExecuted (cognitive 35) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:756— UnverifiedRemoteInstallerScan.ExtractedAndExecuted has cognitive complexity 35 (threshold 15). Of this number, 34 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ReleaseAssetUploadJobsText (cognitive 35) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5516— SupplyChainProvenanceAnalyzer.ReleaseAssetUploadJobsText has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.BuildBasenameIndex (cognitive 35) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3931— ChangeCouplingAnalyzer.BuildBasenameIndex has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodebaseDetail.razor › OnParametersSetAsync (cognitive 35) src/Kennel.Assay.Core/DecisionReports/Ui/CodebaseDetail.razor:209— CodebaseDetail.razor › OnParametersSetAsync has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_dimension_noise.load_language (cognitive 35) tools/depthnoise/build_dimension_noise.py:194— build_dimension_noise.load_language has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (8 pts), ternaries 3 (7 pts), boolean chains 4 (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.
bench.main (cognitive 35) tools/qwen-eval/bench.py:326— bench.main has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (22 pts), error handling 2 (5 pts), boolean chains 3, loops 2 (3 pts), ternaries 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.
BranchWalker.node (cognitive 35) engine/sidecars/php-frontend/body.php:55— BranchWalker.node has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 6 (12 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanSubstring (cognitive 34) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:796— ComplianceSecurityAnalyzer.ScanSubstring has cognitive complexity 34 (threshold 15). 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.
ComplianceSecurityAnalyzer.ResolveDeclaredTypeName (cognitive 34) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1964— ComplianceSecurityAnalyzer.ResolveDeclaredTypeName has cognitive complexity 34 (threshold 15). Of this number, 26 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
UpstreamAttribution.DeclaredThirdPartySubtrees (cognitive 34) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1059— UpstreamAttribution.DeclaredThirdPartySubtrees has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EggMiddlewareNameRefs.StripComments (cognitive 34) engine/src/CodeHealth.Core/Frontend/EggMiddlewareNameRefs.cs:129— EggMiddlewareNameRefs.StripComments has cognitive complexity 34 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendBundlerConfigRefs.CollectFrameworkCliEntries (cognitive 34) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1281— FrontendBundlerConfigRefs.CollectFrameworkCliEntries has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEmittedTemplateRefs.ResolveEmittedTemplateDirectory (cognitive 34) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:480— FrontendEmittedTemplateRefs.ResolveEmittedTemplateDirectory has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsScopeBindings.BindPattern (cognitive 34) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:801— JsScopeBindings.BindPattern has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.CollectCommentTypeImports (cognitive 34) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:163— ModuleSyntaxScanner.CollectCommentTypeImports has cognitive complexity 34 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
IncompletenessAnalyzer.RedundantReturnGuardRuns (cognitive 34) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4011— IncompletenessAnalyzer.RedundantReturnGuardRuns has cognitive complexity 34 (threshold 15). Of this number, 32 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScatteredDecision.Find (cognitive 34) engine/src/CodeHealth.Core/ModelAware/ScatteredDecision.cs:37— ScatteredDecision.Find has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.HasDataVolumeMount (cognitive 34) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2334— ProductionReadinessAnalyzer.HasDataVolumeMount has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitDiffShapes.ParseAsync (cognitive 34) engine/src/CodeHealth.Toolchain/Git/GitDiffShapes.cs:225— GitDiffShapes.ParseAsync has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeMutableServiceImageScan.Services (cognitive 34) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeMutableServiceImageScan.cs:135— ComposeMutableServiceImageScan.Services has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockerfileShapeRuleFilter.EveryPackageStepMountsTheCache (cognitive 34) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:1172— DockerfileShapeRuleFilter.EveryPackageStepMountsTheCache has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedRemoteInstallerScan.OutputPath (cognitive 34) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1228— UnverifiedRemoteInstallerScan.OutputPath has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.FunctionKeepsPositionalInProcess (cognitive 34) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9719— SupplyChainProvenanceAnalyzer.FunctionKeepsPositionalInProcess has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.WorkflowTriggerBranches (cognitive 34) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10706— SupplyChainProvenanceAnalyzer.WorkflowTriggerBranches has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-routing.selection (cognitive 34) tools/train/judge-routing.py:112— judge-routing.selection has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 3 (7 pts), boolean chains 2, error handling 1 (2 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.
BodyFacts.node (cognitive 34) engine/sidecars/php-frontend/body.php:238— BodyFacts.node has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 17, if/else 8 (13 pts), loops 2 (4 pts) (nesting depth added 7). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
body.tokenizeBody (cognitive 34) engine/sidecars/php-frontend/body.php:681— body.tokenizeBody has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDuplicationDetector.AppendMultiplicitySites (cognitive 33) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1744— RoslynDuplicationDetector.AppendMultiplicitySites has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorMarkupReferenceScanner.CollectByBaseTypeAsync (cognitive 33) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:242— RazorMarkupReferenceScanner.CollectByBaseTypeAsync has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectObsoleteAsync (cognitive 33) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:4381— RoslynExplicitDebtCollector.CollectObsoleteAsync has cognitive complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsComplexity.ComputeCognitive (cognitive 33) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:260— JsComplexity.ComputeCognitive has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.SkipTrivia (cognitive 33) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:194— Scanner.SkipTrivia has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.ScanNumber (cognitive 33) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:298— Scanner.ScanNumber has cognitive complexity 33 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModuleResolver.ResolveViaTsConfig (cognitive 33) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:599— ModuleResolver.ResolveViaTsConfig has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.PureQueryHelperNames (cognitive 33) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:745— AccessibilityAnalyzer.PureQueryHelperNames has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataShapeSmellAnalyzer.AnalyzeAsync (cognitive 33) engine/src/CodeHealth.Core/ModelAware/DataShapeSmellAnalyzer.cs:29— DataShapeSmellAnalyzer.AnalyzeAsync has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.RepositoryPerAggregateRoot (cognitive 33) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1577— DomainModelAnalyzer.RepositoryPerAggregateRoot has cognitive complexity 33 (threshold 15). Of this number, 28 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
SelfDeclaredUnreliableTests.Find (cognitive 33) engine/src/CodeHealth.Core/Testing/SelfDeclaredUnreliableTests.cs:182— SelfDeclaredUnreliableTests.Find has cognitive complexity 33 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SolutionShapeAnalyzer.BuildFindings (cognitive 33) engine/src/CodeHealth.Dimensions.CodeQuality/SolutionShape/SolutionShapeAnalyzer.cs:823— SolutionShapeAnalyzer.BuildFindings has cognitive complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
DockerfileShapeRuleFilter.EveryRegistryBaseIsTagged (cognitive 33) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:461— DockerfileShapeRuleFilter.EveryRegistryBaseIsTagged has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedRemoteInstallerScan.FindingsInStage (cognitive 33) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:579— UnverifiedRemoteInstallerScan.FindingsInStage has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowInputGateRecheck.ExpressionYieldsOnlyShellSafeText (cognitive 33) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:105— WorkflowInputGateRecheck.ExpressionYieldsOnlyShellSafeText has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XmlBuildOnlyRecheck.XmlUseIsBuildOnly (cognitive 33) engine/src/CodeHealth.Dimensions.Security/Scanners/XmlBuildOnlyRecheck.cs:62— XmlBuildOnlyRecheck.XmlUseIsBuildOnly has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check.main (cognitive 33) engine/sidecars/scala-frontend/selftest/check.py:48— check.main has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 18, if/else 13 (14 pts), loops 1 (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
build_dimension_noise.main (cognitive 33) tools/depthnoise/build_dimension_noise.py:308— build_dimension_noise.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 7 (12 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bench.run_agent (cognitive 33) tools/qwen-eval/bench.py:142— bench.run_agent has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 8, loops 3 (4 pts), ternaries 2, error handling 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
draw.main (cognitive 33) tools/rescan/draw.py:165— draw.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (15 pts), loops 8 (12 pts), ternaries 2 (4 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.
BranchWalker.walk (cognitive 33) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Body.swift:195— BranchWalker.walk has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (21 pts), loops 6 (12 pts) (nesting depth added 11). 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.
PolyglotConditionScanner.Scan (cognitive 32) engine/src/CodeHealth.Core/CodeShape/PolyglotConditionScanner.cs:183— PolyglotConditionScanner.Scan has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lcom4Calculator.AnalyzeVb (cognitive 32) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:343— Lcom4Calculator.AnalyzeVb has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendWorkspaceLoader.ReadSourceMapProvenance (cognitive 32) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceLoader.BuildOutput.cs:139— FrontendWorkspaceLoader.ReadSourceMapProvenance has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.TrimWiringExtents (cognitive 32) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3932— JsDuplicationDetector.TrimWiringExtents has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleResolver.ModuleResolver.ctor (cognitive 32) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:106— ModuleResolver.ModuleResolver.ctor has cognitive complexity 32 (threshold 15). Of this number, 26 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
NonProductionTreeReadmission.ImportedTrees (cognitive 32) engine/src/CodeHealth.Core/Frontend/NonProductionTreeReadmission.cs:54— NonProductionTreeReadmission.ImportedTrees has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupParser.BlankUnquotedExpressionAttributeValues (cognitive 32) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:986— MarkupParser.BlankUnquotedExpressionAttributeValues has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CiWorkflowReader.TopLevelTriggers (cognitive 32) engine/src/CodeHealth.Core/Readiness/CiWorkflowReader.cs:834— CiWorkflowReader.TopLevelTriggers has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloneSpanShape.Skeleton (cognitive 32) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4506— CloneSpanShape.Skeleton has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockerfileShapeRuleFilter.DropsPrivilegeAtStart (cognitive 32) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:709— DockerfileShapeRuleFilter.DropsPrivilegeAtStart has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpringSecurityActuatorRecheck.ConfiguresSecurity (cognitive 32) engine/src/CodeHealth.Dimensions.Security/Scanners/SpringSecurityActuatorRecheck.cs:164— SpringSecurityActuatorRecheck.ConfiguresSecurity has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.NamesRepoSubtypeOf (cognitive 32) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4243— ChangeCouplingAnalyzer.NamesRepoSubtypeOf has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
arch_corpus.main (cognitive 32) tools/multilang/arch_corpus.py:141— arch_corpus.main has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (5 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.
go_precision_adjudicate.adjudicate (cognitive 32) tools/multilang/go_precision_adjudicate.py:13— go_precision_adjudicate.adjudicate has cognitive complexity 32 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 14 (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.
fallback-judge.cmd_run (cognitive 32) tools/train/fallback-judge.py:210— fallback-judge.cmd_run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AspireAppHostExtractor.Extract (cognitive 31) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/AspireAppHostExtractor.cs:27— AspireAppHostExtractor.Extract has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineBasedGodClassDetector.MeasureLeg (cognitive 31) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:1362— LineBasedGodClassDetector.MeasureLeg has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmManifestHygiene.Read (cognitive 31) engine/src/CodeHealth.Core/Dependencies/NpmManifestHygiene.cs:139— NpmManifestHygiene.Read has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendManifestEntryPoints.CollectMiniProgramEntryPaths (cognitive 31) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:280— FrontendManifestEntryPoints.CollectMiniProgramEntryPaths has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.ScanExpressionBodyEnd (cognitive 31) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:721— JsFunctionScanner.ScanExpressionBodyEnd has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.OrphanedLabels (cognitive 31) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2157— AccessibilityAnalyzer.OrphanedLabels has cognitive complexity 31 (threshold 15). Of this number, 28 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.EnumerateEnforcementFiles (cognitive 31) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9915— AccessibilityAnalyzer.EnumerateEnforcementFiles has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.ConditionsAlreadyDecidedByAnEarlierGuard (cognitive 31) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4349— IncompletenessAnalyzer.ConditionsAlreadyDecidedByAnEarlierGuard has cognitive complexity 31 (threshold 15). Of this number, 29 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupTaintPass.CollectEdges (cognitive 31) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:585— MarkupTaintPass.CollectEdges has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposePsParser.ParseWebTargets (cognitive 31) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/ComposePsParser.cs:28— ComposePsParser.ParseWebTargets has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskSourceFiles.Enumerate (cognitive 31) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1026— DiskSourceFiles.Enumerate has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CredentialScannerAllowlist.ParsePathPatterns (cognitive 31) engine/src/CodeHealth.Core/Security/CredentialScannerAllowlist.cs:118— CredentialScannerAllowlist.ParsePathPatterns has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.UnreadableTestSources (cognitive 31) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:232— DiskTestScanner.UnreadableTestSources has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.HasPesterTestSuite (cognitive 31) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1192— DiskTestScanner.HasPesterTestSuite has cognitive complexity 31 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynTestQualityCollector.AutoApproveReachableBodies (cognitive 31) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1138— RoslynTestQualityCollector.AutoApproveReachableBodies has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsSiblingScopeReadScan.IsRead (cognitive 31) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:324— JsSiblingScopeReadScan.IsRead has cognitive complexity 31 (threshold 15). 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.
JsValueFlow.LocalBindings (cognitive 31) engine/src/CodeHealth.Dimensions.Security/Scanners/JsValueFlow.cs:306— JsValueFlow.LocalBindings has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutableGitCloneScan.Offence (cognitive 31) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:161— MutableGitCloneScan.Offence has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.JsTsImportsSibling (cognitive 31) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:5147— ChangeCouplingAnalyzer.JsTsImportsSibling has cognitive complexity 31 (threshold 15). Of this number, 30 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
coverage-report.parse (cognitive 31) tools/engine-coverage/coverage-report.py:48— coverage-report.parse has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 5 (9 pts), boolean chains 2 (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.
build_gitlab_manifest.main (cognitive 31) tools/multilang/build_gitlab_manifest.py:42— build_gitlab_manifest.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 7, loops 5 (6 pts), ternaries 2 (4 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.
backlog-drop-unreachable.main (cognitive 31) tools/ops/backlog-drop-unreachable.py:118— backlog-drop-unreachable.main has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 6, loops 4 (5 pts), error handling 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractor.extractPackage (cognitive 31) engine/sidecars/go/extract.go:55— extractor.extractPackage has cognitive complexity 31 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 6 (11 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extractor.collectInterfaceAssertions (cognitive 31) engine/sidecars/go/implements.go:114— extractor.collectInterfaceAssertions has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 3 (6 pts), boolean chains 4 (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.
ts-helpers.branchesOf (cognitive 31) engine/sidecars/tsjs-frontend/ts-helpers.mjs:345— ts-helpers.branchesOf has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (19 pts), ternaries 5 (8 pts), boolean chains 4 (nesting depth added 6). Most of this is not in the body itself: 9 of the 31 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 369, 386, 349, …). 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.
BoundaryCouplingDetector.ScanRoslynAsync (cognitive 30) engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:86— BoundaryCouplingDetector.ScanRoslynAsync has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SliceLocalityDetector.Collaborators (cognitive 30) engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:115— SliceLocalityDetector.Collaborators has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorCodeVirtualizer.FindMatchingBrace (cognitive 30) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:225— RazorCodeVirtualizer.FindMatchingBrace has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectImperativeGuards (cognitive 30) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4671— ComplianceSecurityAnalyzer.DetectImperativeGuards has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DartDeadLibraryField.Declarations (cognitive 30) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:433— DartDeadLibraryField.Declarations has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.AddPublishedSubpathSiblings (cognitive 30) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1257— EntryPointCatalog.AddPublishedSubpathSiblings has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.EggBootReached (cognitive 30) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:2033— FrontendTestReachability.EggBootReached has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.MarkCommonJsWiring (cognitive 30) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:7093— JsDuplicationDetector.MarkCommonJsWiring has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.SkipTypeParameters (cognitive 30) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:949— JsFunctionScanner.SkipTypeParameters has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.AriaCorrectness (cognitive 30) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4055— AccessibilityAnalyzer.AriaCorrectness has cognitive complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
AccessibilityAnalyzer.CollectBuildInjectedLangPages (cognitive 30) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5740— AccessibilityAnalyzer.CollectBuildInjectedLangPages has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.EnumerateTemplateLanguageFiles (cognitive 30) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:424— AccessibilityAnalyzer.EnumerateTemplateLanguageFiles has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientInputAnalyzer.Analyze (cognitive 30) engine/src/CodeHealth.Core/ModelAware/AmbientInputAnalyzer.cs:162— AmbientInputAnalyzer.Analyze has cognitive complexity 30 (threshold 15). Of this number, 27 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
ArchitectureModelAnalyzer.InterfaceSegregation (cognitive 30) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:306— ArchitectureModelAnalyzer.InterfaceSegregation has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.DebugOnlyBoundChecks (cognitive 30) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:1292— IncompletenessAnalyzer.DebugOnlyBoundChecks has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.StatementsBothBranchesOpenWith (cognitive 30) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4264— IncompletenessAnalyzer.StatementsBothBranchesOpenWith has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScalaDomainConventions.Dm6InfraLeak (cognitive 30) engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:233— ScalaDomainConventions.Dm6InfraLeak has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.HasPublishVerbInPipelineNamedScript (cognitive 30) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7115— ProductionReadinessAnalyzer.HasPublishVerbInPipelineNamedScript has cognitive complexity 30 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CiGateDetection.SoftFailedAt (cognitive 30) engine/src/CodeHealth.Core/Scoring/CiGateDetection.cs:166— CiGateDetection.SoftFailedAt has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.VbaContainerTestSourceExtensions (cognitive 30) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:445— DiskTestScanner.VbaContainerTestSourceExtensions has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitLogHistoryExtractor.Parse (cognitive 30) engine/src/CodeHealth.Toolchain/Git/GitLogHistoryExtractor.cs:144— GitLogHistoryExtractor.Parse has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleRecommendationEngine.ForMeta (cognitive 30) engine/src/CodeHealth.Reporting/Recommendations/RuleRecommendationEngine.cs:158— RuleRecommendationEngine.ForMeta has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExplicitDebtAnalyzer.ToFinding (cognitive 30) engine/src/CodeHealth.Dimensions.ExplicitDebt/ExplicitDebtAnalyzer.cs:1039— ExplicitDebtAnalyzer.ToFinding has cognitive complexity 30 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GoModuleContextRechecks.AssertedMapKeyIsLocalCompositeLiteral (cognitive 30) engine/src/CodeHealth.Dimensions.Security/Scanners/GoModuleContextRechecks.cs:275— GoModuleContextRechecks.AssertedMapKeyIsLocalCompositeLiteral has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PowerShellFetchExecScriptRecheck.TextLines (cognitive 30) engine/src/CodeHealth.Dimensions.Security/Scanners/PowerShellFetchExecScriptRecheck.cs:102— PowerShellFetchExecScriptRecheck.TextLines has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.SbomAdvice (cognitive 30) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3794— SupplyChainProvenanceAnalyzer.SbomAdvice has cognitive complexity 30 (threshold 15). 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.
SupplyChainProvenanceAnalyzer.ScriptBlocks (cognitive 30) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9471— SupplyChainProvenanceAnalyzer.ScriptBlocks has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Customers.razor › OnInitializedAsync (cognitive 30) src/Kennel.Assay.Core/Governance/Ui/Customers.razor:177— Customers.razor › OnInitializedAsync has cognitive complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
EmitterNames.blankLiterals (cognitive 30) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/EmitterNames.java:92— EmitterNames.blankLiterals has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (8 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Main.main (cognitive 30) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Main.java:32— Main.main has cognitive complexity 30 (threshold 15). Drivers by points: error handling 5 (10 pts), ternaries 4 (8 pts), loops 5 (6 pts), if/else 4, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bakeoff.score_run (cognitive 30) tools/llm-bakeoff/bakeoff.py:204— bakeoff.score_run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (18 pts), ternaries 7 (8 pts), boolean chains 4 (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.
analyse.main (cognitive 30) tools/rescan/analyse.py:65— analyse.main has cognitive complexity 30 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 9 (10 pts), ternaries 2 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
judge-with-tools.run_tool (cognitive 30) tools/train/judge-with-tools.py:77— judge-with-tools.run_tool has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 6, error handling 3 (6 pts), ternaries 1 (2 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.
CSharpSourceScanner.ReadSingleQuoteBody (cognitive 29) engine/src/CodeHealth.Core/ApiSurface/CSharpSourceScanner.cs:219— CSharpSourceScanner.ReadSingleQuoteBody has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ResolveConstantKeyRoot (cognitive 29) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3310— ComplianceSecurityAnalyzer.ResolveConstantKeyRoot has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.IllustrationBlockLines (cognitive 29) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:2844— RoslynExplicitDebtCollector.IllustrationBlockLines has cognitive complexity 29 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RoslynExplicitDebtCollector.CollectNoWarn (cognitive 29) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5080— RoslynExplicitDebtCollector.CollectNoWarn has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.ReadSeverityAssignments (cognitive 29) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:6279— RoslynExplicitDebtCollector.ReadSeverityAssignments has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendMarkupRefs.CollectInlineHtmlModuleImports (cognitive 29) engine/src/CodeHealth.Core/Frontend/FrontendMarkupRefs.cs:154— FrontendMarkupRefs.CollectInlineHtmlModuleImports has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendMarkupRefs.ExtractSrcAttribute (cognitive 29) engine/src/CodeHealth.Core/Frontend/FrontendMarkupRefs.cs:394— FrontendMarkupRefs.ExtractSrcAttribute has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.ScanDataInitialiser (cognitive 29) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1716— FrontendTestReachability.ScanDataInitialiser has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndentedMarkupProducer.ReadValue (cognitive 29) engine/src/CodeHealth.Core/Markup/IndentedMarkupProducer.cs:697— IndentedMarkupProducer.ReadValue has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.IntegrationEventCoupling (cognitive 29) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:801— DomainModelAnalyzer.IntegrationEventCoupling has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.SyncInHandler (cognitive 29) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1285— EventDrivenAnalyzer.SyncInHandler has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynProjectStatistician.CollectAsync (cognitive 29) engine/src/CodeHealth.Core/Statistics/RoslynProjectStatistician.cs:13— RoslynProjectStatistician.CollectAsync has cognitive complexity 29 (threshold 15). Of this number, 27 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CommittedCoverageReader.MergeXmlPerFile (cognitive 29) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:957— CommittedCoverageReader.MergeXmlPerFile has cognitive complexity 29 (threshold 15). Of this number, 28 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.MergeIstanbulJsonPerFile (cognitive 29) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1179— CommittedCoverageReader.MergeIstanbulJsonPerFile has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynTestQualityCollector.BuildHelperIndex (cognitive 29) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:450— RoslynTestQualityCollector.BuildHelperIndex has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.ForkFamilies (cognitive 29) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1065— DuplicationAnalyzer.ForkFamilies has cognitive complexity 29 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
JsValueFlow.MaskStringLiteralContents (cognitive 29) engine/src/CodeHealth.Dimensions.Security/Scanners/JsValueFlow.cs:120— JsValueFlow.MaskStringLiteralContents has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StaticAnalysisAnalyzer.RunAsync (cognitive 29) engine/src/CodeHealth.Dimensions.Security/StaticAnalysisAnalyzer.cs:85— StaticAnalysisAnalyzer.RunAsync has cognitive complexity 29 (threshold 15). Of this number, 16 points are the body's own statements and 13 belong to 6 function literals inside it that branch. 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.
SupplyChainProvenanceAnalyzer.MutableContainerImagePulls (cognitive 29) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1250— SupplyChainProvenanceAnalyzer.MutableContainerImagePulls has cognitive complexity 29 (threshold 15). Of this number, 26 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepoFindings.razor › HideRuleAsync (cognitive 29) src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:1267— RepoFindings.razor › HideRuleAsync has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelBuilder.BuildMembers (cognitive 29) engine/src/CodeHealth.CodeModel.Jvm/Builder.cs:336— ModelBuilder.BuildMembers has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rate_audit.main (cognitive 29) tools/train/rate_audit.py:80— rate_audit.main has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 8 (16 pts), if/else 5 (11 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 29) src/Kennel.Ui/wwwroot/kennel-ui.js:2073— (anonymous) has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12, ternaries 7 (9 pts), boolean chains 6, loops 2 (nesting depth added 2). Most of this is not in the body itself: 2 of the 29 points are its own statements and the rest belongs to 7 function items inside it that branch (dsmInit::(anonymous), dsmInit::highlight, dsmInit, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SourceClassifier.IsDemoPrefixedSampleProject (cognitive 28) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3023— SourceClassifier.IsDemoPrefixedSampleProject has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lcom4Calculator.Analyze (cognitive 28) engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:518— Lcom4Calculator.Analyze has cognitive complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ComplianceSecurityAnalyzer.ScanCredentialExposure (cognitive 28) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1436— ComplianceSecurityAnalyzer.ScanCredentialExposure has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanUnauthenticatedCipherMode (cognitive 28) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2418— ComplianceSecurityAnalyzer.ScanUnauthenticatedCipherMode has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemDocumentationCollector.CollectAsync (cognitive 28) engine/src/CodeHealth.Core/Docs/FileSystemDocumentationCollector.cs:19— FileSystemDocumentationCollector.CollectAsync has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectThirdPartyBuildOutputImports (cognitive 28) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1786— FrontendBoundaries.CollectThirdPartyBuildOutputImports has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendComplexity.Analyze (cognitive 28) engine/src/CodeHealth.Core/Frontend/FrontendComplexity.cs:79— FrontendComplexity.Analyze has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.GitignorePatternMayCover (cognitive 28) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:772— FrontendDeadCode.GitignorePatternMayCover has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.GitignoreGlobMatches (cognitive 28) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:837— FrontendDeadCode.GitignoreGlobMatches has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaggedTemplateMarkupProducer.Read (cognitive 28) engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:69— TaggedTemplateMarkupProducer.Read has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.NeverInteractiveComponentTags (cognitive 28) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:1495— AccessibilityAnalyzer.NeverInteractiveComponentTags has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CollectCssPointerClasses (cognitive 28) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5507— AccessibilityAnalyzer.CollectCssPointerClasses has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.EventCommandShape (cognitive 28) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1583— EventDrivenAnalyzer.EventCommandShape has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.InspectContradictedHandoff (cognitive 28) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:2603— LogicDefectAnalyzer.InspectContradictedHandoff has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScatteredDerivation.Find (cognitive 28) engine/src/CodeHealth.Core/ModelAware/ScatteredDerivation.cs:43— ScatteredDerivation.Find has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VacuousFormatGate.Detect (cognitive 28) engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs:121— VacuousFormatGate.Detect has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredScriptExecutables.ForRepo (cognitive 28) engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:165— DeclaredScriptExecutables.ForRepo has cognitive complexity 28 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DiskSourceFiles.HasFrontendSource (cognitive 28) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1488— DiskSourceFiles.HasFrontendSource has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. This shape REPEATS in the file: one other method here (DiskSourceFiles.EnumerateFrontend) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DiskSourceFiles.EnumerateFrontend (cognitive 28) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1558— DiskSourceFiles.EnumerateFrontend has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. This shape REPEATS in the file: one other method here (DiskSourceFiles.HasFrontendSource) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
DiskTestScanner.JsTestFiles (cognitive 28) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:919— DiskTestScanner.JsTestFiles has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProcessToolRunner.RunAsync (cognitive 28) engine/src/CodeHealth.Toolchain/Tools/ProcessToolRunner.cs:17— ProcessToolRunner.RunAsync has cognitive complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 3 function literals inside it that branch. 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.
DegradedDiagnosticsReport.Render (cognitive 28) engine/src/CodeHealth.Cli/Diagnostics/DegradedDiagnosticsReport.cs:30— DegradedDiagnosticsReport.Render has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InternalApiConsistencyAnalyzer.RunAsync (cognitive 28) engine/src/CodeHealth.Dimensions.Architecture/InternalApiConsistencyAnalyzer.cs:24— InternalApiConsistencyAnalyzer.RunAsync has cognitive complexity 28 (threshold 15). Of this number, 27 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DeclaredDependencies.FromManifests (cognitive 28) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:838— DeclaredDependencies.FromManifests has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.DeclareLocals (cognitive 28) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:595— FileModel.DeclareLocals has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.ExpressionNeutralises (cognitive 28) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:892— FileModel.ExpressionNeutralises has cognitive complexity 28 (threshold 15). 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.
gold-record.main (cognitive 28) tools/train/gold-record.py:37— gold-record.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3, loops 2 (3 pts), ternaries 3 (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.
ServiceProjectPartition.Build (cognitive 27) engine/src/CodeHealth.Core/Architecture/ServiceProjectPartition.cs:17— ServiceProjectPartition.Build has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineBasedGodClassDetector.DisjointFieldClusters (cognitive 27) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:415— LineBasedGodClassDetector.DisjointFieldClusters has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralMethodLengthScanner.DeclaredMethodsByFile (cognitive 27) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:389— NeutralMethodLengthScanner.DeclaredMethodsByFile has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoModuleHygiene.Read (cognitive 27) engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:117— GoModuleHygiene.Read has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectPragmaDisables (cognitive 27) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:3974— RoslynExplicitDebtCollector.CollectPragmaDisables has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildOutputSources.ToSource (cognitive 27) engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:45— BuildOutputSources.ToSource has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryForkDetector.Analyze (cognitive 27) engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:154— DirectoryForkDetector.Analyze has cognitive complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendManifestEntryPoints.CollectWebExtensionScriptRefs (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:535— FrontendManifestEntryPoints.CollectWebExtensionScriptRefs has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.CollectPnpmLockPeerContracts (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:961— FrontendScriptCommandRefs.CollectPnpmLockPeerContracts has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestAndDocRefs.AddImportMapKeys (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:512— FrontendTestAndDocRefs.AddImportMapKeys has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestSuiteMasking.CollectExcludedFileModuleRefs (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:713— FrontendTestSuiteMasking.CollectExcludedFileModuleRefs has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendToolAndRuntimeRefs.CollectToolConfigModuleRefs (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:29— FrontendToolAndRuntimeRefs.CollectToolConfigModuleRefs has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendToolAndRuntimeRefs.CollectPackageRootSpawnRefs (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:392— FrontendToolAndRuntimeRefs.CollectPackageRootSpawnRefs has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendWorkspaceWalk.CollectScriptExecutedToolTreeImports (cognitive 27) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:569— FrontendWorkspaceWalk.CollectScriptExecutedToolTreeImports has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleResolver.Resolve (cognitive 27) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:284— ModuleResolver.Resolve has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CountProgrammaticDomFactoryCalls (cognitive 27) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6090— AccessibilityAnalyzer.CountProgrammaticDomFactoryCalls has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CountUnreadTemplateMarkup (cognitive 27) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs:128— AccessibilityAnalyzer.CountUnreadTemplateMarkup has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.PrimitiveDataClumps (cognitive 27) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5228— DomainModelAnalyzer.PrimitiveDataClumps has cognitive complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
MarkupTaintPass.CollectAsync (cognitive 27) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:334— MarkupTaintPass.CollectAsync has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodebaseSize.CountTestLocFromCsprojPathsAsync (cognitive 27) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:305— CodebaseSize.CountTestLocFromCsprojPathsAsync has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ArchGraphSvg.Render (cognitive 27) engine/src/CodeHealth.Reporting/Svg/ArchGraphSvg.cs:19— ArchGraphSvg.Render has cognitive complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeHostNamespaceScan.FindingsIn (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeHostNamespaceScan.cs:118— ComposeHostNamespaceScan.FindingsIn has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.FixSatisfiesOpenPythonRequirement (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:655— DeclaredDependencies.FixSatisfiesOpenPythonRequirement has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.ParseCargoWorkspaceMembers (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1017— DeclaredDependencies.ParseCargoWorkspaceMembers has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockerfileShapeRuleFilter.Filter (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileShapeRuleFilter.cs:161— DockerfileShapeRuleFilter.Filter has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupEscapingRecheck.ReadHtmlValueExpression (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:159— MarkupEscapingRecheck.ReadHtmlValueExpression has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SemgrepClaimRecheck.PremiseRefutedByTheCitedSource (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs:293— SemgrepClaimRecheck.PremiseRefutedByTheCitedSource has cognitive complexity 27 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UnverifiedTrustAnchorScan.FetchLine (cognitive 27) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedTrustAnchorScan.cs:360— UnverifiedTrustAnchorScan.FetchLine has cognitive complexity 27 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.JobSteps (cognitive 27) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2140— SupplyChainProvenanceAnalyzer.JobSteps has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ScopesEveryJob (cognitive 27) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6179— SupplyChainProvenanceAnalyzer.ScopesEveryJob has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Branches.walk (cognitive 27) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Branches.java:96— Branches.walk has cognitive complexity 27 (threshold 15). Drivers by points: loops 11 (12 pts), if/else 3 (6 pts), ternaries 3 (6 pts), boolean chains 3 (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.
render_dimension_noise.beeswarm (cognitive 27) tools/depthnoise/render_dimension_noise.py:96— render_dimension_noise.beeswarm has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 4 (10 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render_dimension_noise.render (cognitive 27) tools/depthnoise/render_dimension_noise.py:156— render_dimension_noise.render has cognitive complexity 27 (threshold 15). Drivers by points: loops 9 (13 pts), if/else 6 (11 pts), ternaries 1 (2 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.
audit-rubrics.main (cognitive 27) tools/train/audit-rubrics.py:36— audit-rubrics.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 5, loops 4, ternaries 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
programme-status.stale_window_report (cognitive 27) tools/train/programme-status.py:260— programme-status.stale_window_report has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 2 (4 pts), boolean chains 3, error handling 1 (2 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
programme-status.divergent_gold_report (cognitive 27) tools/train/programme-status.py:401— programme-status.divergent_gold_report has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 4, error handling 1 (2 pts), loops 2, ternaries 1 (2 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.
report_round.measure_dimensions (cognitive 27) tools/train/report_round.py:294— report_round.measure_dimensions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 10, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sidecarlib.arm_status (cognitive 27) tools/train/sidecarlib.py:150— sidecarlib.arm_status has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (11 pts), error handling 4 (7 pts), boolean chains 5, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.scanBodyText (cognitive 27) engine/sidecars/go/bodylines.go:557— main.scanBodyText has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, loops 2 (3 pts), match/switch 1 (2 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.
(anonymous) (cognitive 27) src/Kennel.Ui/wwwroot/kennel-ui.js:1810— (anonymous) has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 9, ternaries 3 (4 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 17 function items inside it that branch (wire::render, wire, wire::render::(anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SliceLocalityDetector.LocalityAsync (cognitive 26) engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:19— SliceLocalityDetector.LocalityAsync has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.EnumerateEcosystemMarkers (cognitive 26) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3633— SourceClassifier.EnumerateEcosystemMarkers has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChainedFamilyRollup.Append (cognitive 26) engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:93— ChainedFamilyRollup.Append has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BundlerManifestHygiene.ReadLocks (cognitive 26) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:439— BundlerManifestHygiene.ReadLocks has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDeadCodeDetector.IsCandidate (cognitive 26) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:361— RoslynDeadCodeDetector.IsCandidate has cognitive complexity 26 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
ObsoleteSuppressionScopes.Build (cognitive 26) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5720— ObsoleteSuppressionScopes.Build has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectVbInvertedNullGuards (cognitive 26) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.Vb.cs:111— RoslynExplicitDebtCollector.CollectVbInvertedNullGuards has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectTestSuiteDependencyViolations (cognitive 26) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:952— FrontendBoundaries.CollectTestSuiteDependencyViolations has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.IsDependencyUsed (cognitive 26) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:722— FrontendDependencyHygiene.IsDependencyUsed has cognitive complexity 26 (threshold 15). 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.
JsFunctionScanner.Scan (cognitive 26) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:17— JsFunctionScanner.Scan has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleResolver.ResolveWorkspacePackage (cognitive 26) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:719— ModuleResolver.ResolveWorkspacePackage has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.ScanExportClause (cognitive 26) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:868— ModuleSyntaxScanner.ScanExportClause has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.SelfDirectoryCompositionArg (cognitive 26) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1174— ModuleSyntaxScanner.SelfDirectoryCompositionArg has cognitive complexity 26 (threshold 15). 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.
ModuleSyntaxScanner.PatternBindingNames (cognitive 26) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:2015— ModuleSyntaxScanner.PatternBindingNames has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.IsFocusForwardingOnly (cognitive 26) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:8898— AccessibilityAnalyzer.IsFocusForwardingOnly has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.NestingControlAncestor (cognitive 26) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9306— AccessibilityAnalyzer.NestingControlAncestor has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsprojReferenceGraph.Build (cognitive 26) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:60— CsprojReferenceGraph.Build has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.PrimitiveDataClumps (cognitive 26) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:453— DomainModelAnalyzer.PrimitiveDataClumps has cognitive complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
MutationIdempotencyAnalyzer.GatherRoslynAsync (cognitive 26) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:667— MutationIdempotencyAnalyzer.GatherRoslynAsync has cognitive complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.GatherNeutralAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
MutationIdempotencyAnalyzer.GatherNeutralAsync (cognitive 26) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:769— MutationIdempotencyAnalyzer.GatherNeutralAsync has cognitive complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MutationIdempotencyAnalyzer.GatherRoslynAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TestFrameworkDetector.Detect (cognitive 26) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs:135— TestFrameworkDetector.Detect has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainHygieneAnalyzer.Detect (cognitive 26) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:56— SupplyChainHygieneAnalyzer.Detect has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangelogNarrator.SemanticDedupeAsync (cognitive 26) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:447— ChangelogNarrator.SemanticDedupeAsync has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BrowserSandboxDisabledScan.SedInPlaceOperands (cognitive 26) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:252— BrowserSandboxDisabledScan.SedInPlaceOperands has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedSecretManifestScan.CommittedCredentialEntries (cognitive 26) engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:217— CommittedSecretManifestScan.CommittedCredentialEntries has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SemgrepUnsafeAdvice.DoesArithmeticOnAUintptr (cognitive 26) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepUnsafeAdvice.cs:227— SemgrepUnsafeAdvice.DoesArithmeticOnAUintptr has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowInputGateRecheck.NeedsOf (cognitive 26) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:359— WorkflowInputGateRecheck.NeedsOf has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.SigningAdvice (cognitive 26) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:3448— SupplyChainProvenanceAnalyzer.SigningAdvice has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SupplyChainProvenanceAnalyzer.PrTestStepSecretBindings (cognitive 26) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:6789— SupplyChainProvenanceAnalyzer.PrTestStepSecretBindings has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ManifestDeclaredScripts (cognitive 26) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:109— SupplyChainProvenanceAnalyzer.ManifestDeclaredScripts has cognitive complexity 26 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
OpenAiCompatibleLlmProvider.CompleteAsync (cognitive 26) engine/src/CodeHealth.Llm.OpenAiCompatible/OpenAiCompatibleLlmProvider.cs:112— OpenAiCompatibleLlmProvider.CompleteAsync has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BodyEmit.forBody (cognitive 26) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/BodyEmit.scala:37— BodyEmit.forBody has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
main.field_members (cognitive 26) engine/sidecars/python-frontend/main.py:67— main.field_members has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (8 pts), boolean chains 3, ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
render_depth_noise.render (cognitive 26) tools/depthnoise/render_depth_noise.py:72— render_depth_noise.render has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (7 pts), ternaries 2 (4 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.
quality.main (cognitive 26) tools/llm-bakeoff/quality.py:63— quality.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 6, loops 6, ternaries 3 (6 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.
diff.compare (cognitive 26) tools/rescan/diff.py:102— diff.compare has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 9, loops 4 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
holdout-draw.main (cognitive 26) tools/train/holdout-draw.py:43— holdout-draw.main has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 6 (7 pts), boolean chains 2, error handling 1 (2 pts), ternaries 1 (2 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.
judge-validation-status.coverage_states (cognitive 26) tools/train/judge-validation-status.py:40— judge-validation-status.coverage_states has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-with-tools.judge_one (cognitive 26) tools/train/judge-with-tools.py:153— judge-with-tools.judge_one has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
seed-backlog.main (cognitive 26) tools/train/seed-backlog.py:80— seed-backlog.main has cognitive complexity 26 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 4 (7 pts), ternaries 4 (5 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ApiSurfaceExtractor.ScanControllerMethods (cognitive 25) engine/src/CodeHealth.Core/ApiSurface/ApiSurfaceExtractor.cs:349— ApiSurfaceExtractor.ScanControllerMethods has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SliceLocalityDetector.LocalityAsync (cognitive 25) engine/src/CodeHealth.Core/Architecture/SliceLocalityDetector.cs:157— SliceLocalityDetector.LocalityAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDuplicationDetector.IsSelfContainedTestSupportModule (cognitive 25) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:3021— RoslynDuplicationDetector.IsSelfContainedTestSupportModule has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DartDeadLibraryField.IsFieldDeclaration (cognitive 25) engine/src/CodeHealth.Core/Dart/DartDeadLibraryField.cs:601— DartDeadLibraryField.IsFieldDeclaration has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftPackageHygiene.StripComments (cognitive 25) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:503— SwiftPackageHygiene.StripComments has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdrDetector.ReadNavigationConfigs (cognitive 25) engine/src/CodeHealth.Core/Docs/AdrDetector.cs:1028— AdrDetector.ReadNavigationConfigs has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynCommentSampler.SampleAsync (cognitive 25) engine/src/CodeHealth.Core/Docs/CommentSampler.cs:38— RoslynCommentSampler.SampleAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectDeadLoopAccumulators (cognitive 25) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1190— RoslynExplicitDebtCollector.CollectDeadLoopAccumulators has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.DepictedAssignmentLines (cognitive 25) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:2674— RoslynExplicitDebtCollector.DepictedAssignmentLines has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpstreamAttribution.HeaderBanner (cognitive 25) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1803— UpstreamAttribution.HeaderBanner has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildOutputSources.FromManifestDeclaredOutputDirectory (cognitive 25) engine/src/CodeHealth.Core/Frontend/BuildOutputSources.cs:165— BuildOutputSources.FromManifestDeclaredOutputDirectory has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.FindUnregisteredContributions (cognitive 25) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:330— FrontendDeadCode.FindUnregisteredContributions has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEngineDimensions.SiblingFamilyFindings (cognitive 25) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:1357— FrontendEngineDimensions.SiblingFamilyFindings has cognitive complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 3 function literals inside it that branch. 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.
Scanner.ScanTemplateChunk (cognitive 25) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:607— Scanner.ScanTemplateChunk has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.SkipReturnTypeAnnotation (cognitive 25) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1568— ModuleSyntaxScanner.SkipReturnTypeAnnotation has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoherenceSmellAnalyzer.AnalyzeAsync (cognitive 25) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:37— CoherenceSmellAnalyzer.AnalyzeAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainConventions.IsDomainEvent (cognitive 25) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1040— DomainConventions.IsDomainEvent has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EventSourcingAnalyzer.AnalyzeAsync (cognitive 25) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:117— EventSourcingAnalyzer.AnalyzeAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupTaintPass.IsTainted (cognitive 25) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:181— MarkupTaintPass.IsTainted has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainComplexityClassifier.Classify (cognitive 25) engine/src/CodeHealth.Core/Scoring/DomainComplexity.cs:20— DomainComplexityClassifier.Classify has cognitive complexity 25 (threshold 15). 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.
CompileExcludedTestFiles.Scan (cognitive 25) engine/src/CodeHealth.Core/Testing/CompileExcludedTestFiles.cs:40— CompileExcludedTestFiles.Scan has cognitive complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DuplicationAnalyzer.IndexShardParents (cognitive 25) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:1266— DuplicationAnalyzer.IndexShardParents has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GodClassAnalyzer.AbsorbModuleRowsIntoFileRows (cognitive 25) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:711— GodClassAnalyzer.AbsorbModuleRowsIntoFileRows has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildTimeKeyMaterialScan.WorldReadable (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:375— BuildTimeKeyMaterialScan.WorldReadable has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsrfProtectionRecheck.AnIncludedConcernProtects (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/CsrfProtectionRecheck.cs:87— CsrfProtectionRecheck.AnIncludedConcernProtects has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.ParseCargoToml (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1614— DeclaredDependencies.ParseCargoToml has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoModuleContextRechecks.EnclosingGoModulePaths (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/GoModuleContextRechecks.cs:201— GoModuleContextRechecks.EnclosingGoModulePaths has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsSiblingScopeReadScan.ParameterListSpans (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:565— JsSiblingScopeReadScan.ParameterListSpans has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmLockGraph.DeclaredEntryAbove (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:333— NpmLockGraph.DeclaredEntryAbove has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SocketAndUpgradeRecheck.NotGorillaUpgradeCall (cognitive 25) engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:270— SocketAndUpgradeRecheck.NotGorillaUpgradeCall has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.LocatePublishCommand (cognitive 25) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PublishTrigger.cs:181— SupplyChainProvenanceAnalyzer.LocatePublishCommand has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LlmAdrConformanceChecker.CheckAsync (cognitive 25) engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrConformanceChecker.cs:23— LlmAdrConformanceChecker.CheckAsync has cognitive complexity 25 (threshold 15). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to one function literal inside it that branches (line 37). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
FSharpBody.strippedText (cognitive 25) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:474— FSharpBody.strippedText has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (10 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter.emitType (cognitive 25) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Emitter.scala:66— Emitter.emitType has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18, boolean chains 6, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
expand_corpus.discover_language (cognitive 25) tools/multilang/expand_corpus.py:151— expand_corpus.discover_language has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-calibration.ask (cognitive 25) tools/train/judge-calibration.py:982— judge-calibration.ask has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 7, ternaries 1 (4 pts), loops 2 (3 pts), error handling 1 (2 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.
ApiSurfaceExtractor.FindFollowingMethodName (cognitive 24) engine/src/CodeHealth.Core/ApiSurface/ApiSurfaceExtractor.cs:554— ApiSurfaceExtractor.FindFollowingMethodName has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureMapBuilder.ReferencedNamedTypes (cognitive 24) engine/src/CodeHealth.Core/Architecture/ArchitectureMapBuilder.cs:259— ArchitectureMapBuilder.ReferencedNamedTypes has cognitive complexity 24 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ComplianceSecurityAnalyzer.ScanOptInGates (cognitive 24) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3858— ComplianceSecurityAnalyzer.ScanOptInGates has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PiiDataMapAnalyzer.AnalyzeAsync (cognitive 24) engine/src/CodeHealth.Core/Compliance/PiiDataMap.cs:44— PiiDataMapAnalyzer.AnalyzeAsync has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneratedCodePolicy.ParseFlutterL10n (cognitive 24) engine/src/CodeHealth.Core/FileQuality/GeneratedCodePolicy.cs:708— GeneratedCodePolicy.ParseFlutterL10n has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientDeclarationFile.IsAmbientDeclarationFile (cognitive 24) engine/src/CodeHealth.Core/Frontend/AmbientDeclarationFile.cs:34— AmbientDeclarationFile.IsAmbientDeclarationFile has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.LiveTwinOf (cognitive 24) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1608— FrontendDeadCode.LiveTwinOf has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportUsageSolver.CollectReExports (cognitive 24) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:2143— ExportUsageSolver.CollectReExports has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.CollectLockfilePeerContractsIn (cognitive 24) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:866— FrontendScriptCommandRefs.CollectLockfilePeerContractsIn has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.FindsSpecifierInImportPosition (cognitive 24) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:128— FrontendSpecifierScanning.FindsSpecifierInImportPosition has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.SnapStraddlingExtentsToMembers (cognitive 24) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3260— JsDuplicationDetector.SnapStraddlingExtentsToMembers has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.FindBodyOpen (cognitive 24) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:824— JsFunctionScanner.FindBodyOpen has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleResolver.TryResolveExports (cognitive 24) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:1016— ModuleResolver.TryResolveExports has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlatformSubstitutionTable.From (cognitive 24) engine/src/CodeHealth.Core/Frontend/PlatformSubstitutionTable.cs:51— PlatformSubstitutionTable.From has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SfcScriptExtractor.AttributesIndicateTypeScript (cognitive 24) engine/src/CodeHealth.Core/Frontend/SfcScriptExtractor.cs:220— SfcScriptExtractor.AttributesIndicateTypeScript has cognitive complexity 24 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TokenAlignment.MatchingBlocks (cognitive 24) engine/src/CodeHealth.Core/Frontend/TokenAlignment.cs:27— TokenAlignment.MatchingBlocks has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.PageStructureElement (cognitive 24) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:3254— AccessibilityAnalyzer.PageStructureElement has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CollectCssHiddenClasses (cognitive 24) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5425— AccessibilityAnalyzer.CollectCssHiddenClasses has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainConventions.IsValueObject (cognitive 24) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1177— DomainConventions.IsValueObject has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DomainModelAnalyzer.StronglyTypedIds (cognitive 24) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2156— DomainModelAnalyzer.StronglyTypedIds has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EventDrivenAnalyzer.MessageTypesHandledBy (cognitive 24) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:551— EventDrivenAnalyzer.MessageTypesHandledBy has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventSourcingAnalyzer.ImmutableEvents (cognitive 24) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1007— EventSourcingAnalyzer.ImmutableEvents has cognitive complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
IncompletenessAnalyzer.ReturnsInterfaceDeclaredNullSentinel (cognitive 24) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:2315— IncompletenessAnalyzer.ReturnsInterfaceDeclaredNullSentinel has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.UsageBannerCommentLines (cognitive 24) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3683— IncompletenessAnalyzer.UsageBannerCommentLines has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.ApplyOneHopReachabilityAsync (cognitive 24) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:4645— IncompletenessAnalyzer.ApplyOneHopReachabilityAsync has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepoProfiler.DetectEventSourcing (cognitive 24) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:654— RepoProfiler.DetectEventSourcing has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 3 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StringContractSmellAnalyzer.Collect (cognitive 24) engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:130— StringContractSmellAnalyzer.Collect has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainHygieneAnalyzer.DeclaresGoDependencies (cognitive 24) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:248— SupplyChainHygieneAnalyzer.DeclaresGoDependencies has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainHygieneAnalyzer.BuildCard (cognitive 24) engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:447— SupplyChainHygieneAnalyzer.BuildCard has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeterministicNamingSampler.SampleAsync (cognitive 24) engine/src/CodeHealth.Core/Naming/DeterministicNamingSampler.cs:12— DeterministicNamingSampler.SampleAsync has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotnetProjectLicensesCollector.NuGetFallbackAsync (cognitive 24) engine/src/CodeHealth.Core/Security/DotnetProjectLicensesCollector.cs:222— DotnetProjectLicensesCollector.NuGetFallbackAsync has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsTestQualityCensus.DeclarationBody (cognitive 24) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:657— JsTestQualityCensus.DeclarationBody has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DsmHtml.AppendDetails (cognitive 24) engine/src/CodeHealth.Reporting/Architecture/DsmHtml.cs:219— DsmHtml.AppendDetails has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeSetBuilder.MergeCommitSubsetShadows (cognitive 24) engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:222— ChangeSetBuilder.MergeCommitSubsetShadows has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EngineeringReportRenderer.RenderMarkdown (cognitive 24) engine/src/CodeHealth.Reporting/Engineering/EngineeringReportRenderer.cs:83— EngineeringReportRenderer.RenderMarkdown has cognitive complexity 24 (threshold 15). Of this number, 21 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
DsmSvg.Render (cognitive 24) engine/src/CodeHealth.Reporting/Svg/DsmSvg.cs:38— DsmSvg.Render has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReportViewModelFactory.BuildNewSinceLast (cognitive 24) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1352— ReportViewModelFactory.BuildNewSinceLast has cognitive complexity 24 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
GodClassAnalyzer.ReduceMove (cognitive 24) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:1288— GodClassAnalyzer.ReduceMove has cognitive complexity 24 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AutomountedServiceAccountTokenScan.PodSpec (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/AutomountedServiceAccountTokenScan.cs:207— AutomountedServiceAccountTokenScan.PodSpec has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.SelectDeclaration (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:318— DeclaredDependencies.SelectDeclaration has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamelessWorkloadPrivilegedScan.IsNamelessWorkloadDocument (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadPrivilegedScan.cs:156— NamelessWorkloadPrivilegedScan.IsNamelessWorkloadDocument has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.AdvisoryInstalledVersions (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:1153— ScanParsers.AdvisoryInstalledVersions has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.LockResolvedMajors (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:2812— ScanParsers.LockResolvedMajors has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.RegionNeutralises (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:742— FileModel.RegionNeutralises has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedTrustAnchorScan.OffendingFetch (cognitive 24) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedTrustAnchorScan.cs:177— UnverifiedTrustAnchorScan.OffendingFetch has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretsHistoryAnalyzer.GateRenamedIntoTestTreeFindingsAsync (cognitive 24) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:2127— SecretsHistoryAnalyzer.GateRenamedIntoTestTreeFindingsAsync has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.MovingNpmGitDependencies (cognitive 24) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1702— SupplyChainProvenanceAnalyzer.MovingNpmGitDependencies has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepoFindings.razor › OnInitializedAsync (cognitive 24) src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:688— RepoFindings.razor › OnInitializedAsync has cognitive complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
FSharpSyntaxModel.collectDecls (cognitive 24) engine/src/CodeHealth.CodeModel.FSharp/SyntaxModel.fs:540— FSharpSyntaxModel.collectDecls has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 6 (9 pts), loops 2 (4 pts), boolean chains 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.
Branches.walk (cognitive 24) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Branches.kt:40— Branches.walk has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), match/switch 2 (3 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.
Handler._proxy (cognitive 24) tools/qwen-poc/effort-proxy.py:54— Handler._proxy has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 4 (5 pts), boolean chains 4, 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.
report_round.build_rows (cognitive 24) tools/train/report_round.py:143— report_round.build_rows has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 17, if/else 2 (4 pts), loops 3 (nesting depth added 2). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
main.foldNamesOf (cognitive 24) engine/sidecars/go/bodylines.go:729— main.foldNamesOf has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 13). Most of this is not in the body itself: 0 of the 24 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 744, 731). 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.
ConventionalArchitectureTestDiscovery.DiscoverAsync (cognitive 23) engine/src/CodeHealth.Core/Analyzers/ConventionalArchitectureTestDiscovery.cs:12— ConventionalArchitectureTestDiscovery.DiscoverAsync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceDependencyGraphBuilder.Build (cognitive 23) engine/src/CodeHealth.Core/Architecture/NamespaceDependencyGraphBuilder.cs:103— NamespaceDependencyGraphBuilder.Build has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CloudFormationExtractor.Extract (cognitive 23) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/CloudFormationExtractor.cs:24— CloudFormationExtractor.Extract has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDuplicationDetector.IdiomSwaps (cognitive 23) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2348— RoslynDuplicationDetector.IdiomSwaps has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.SerialisedMemberTypes (cognitive 23) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1739— ComplianceSecurityAnalyzer.SerialisedMemberTypes has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanStaticEncryptionIv (cognitive 23) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2181— ComplianceSecurityAnalyzer.ScanStaticEncryptionIv has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectAgeBasedRetentionFields (cognitive 23) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4476— ComplianceSecurityAnalyzer.DetectAgeBasedRetentionFields has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YamlDisabledConfigScanner.TryConvict (cognitive 23) engine/src/CodeHealth.Core/ExplicitDebt/YamlDisabledConfigScanner.cs:531— YamlDisabledConfigScanner.TryConvict has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.AddResolvedThroughAlias (cognitive 23) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2072— EntryPointCatalog.AddResolvedThroughAlias has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBundlerConfigRefs.HandleFile (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:11— FrontendBundlerConfigRefs.HandleFile has cognitive complexity 23 (threshold 15). 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.
FrontendDependencyHygiene.CollectTypeAndTestOnly (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1765— FrontendDependencyHygiene.CollectTypeAndTestOnly has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.EnumerateToolConfigFiles (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:590— FrontendSpecifierScanning.EnumerateToolConfigFiles has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestAndDocRefs.EnumerateMarkdownFiles (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:994— FrontendTestAndDocRefs.EnumerateMarkdownFiles has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.DetectMissingComponentRig (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:853— FrontendTestReachability.DetectMissingComponentRig has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.IsReExportBarrel (cognitive 23) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1399— FrontendTestReachability.IsReExportBarrel has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsConstantOnlyField.Classes (cognitive 23) engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:309— JsConstantOnlyField.Classes has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsFunctionScanner.NameBeforeTypeAnnotation (cognitive 23) engine/src/CodeHealth.Core/Frontend/JsFunctionScanner.cs:1109— JsFunctionScanner.NameBeforeTypeAnnotation has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsRedundantReDefault.FallbackOf (cognitive 23) engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs:225— JsRedundantReDefault.FallbackOf has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.IsInsideFunctionBody (cognitive 23) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1402— ModuleSyntaxScanner.IsInsideFunctionBody has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TemplateLanguageMarkupProducer.Mask (cognitive 23) engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:207— TemplateLanguageMarkupProducer.Mask has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TemplateLanguageMarkupProducer.EndOfBladeDirective (cognitive 23) engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:361— TemplateLanguageMarkupProducer.EndOfBladeDirective has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AmbientInputAnalyzer.Analyze (cognitive 23) engine/src/CodeHealth.Core/ModelAware/AmbientInputAnalyzer.cs:98— AmbientInputAnalyzer.Analyze has cognitive complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ArchitectureModelAnalyzer.UnguardedMutations (cognitive 23) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1108— ArchitectureModelAnalyzer.UnguardedMutations has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureStyleDetector.DetectAsync (cognitive 23) engine/src/CodeHealth.Core/ModelAware/ArchitectureStyleDetector.cs:99— ArchitectureStyleDetector.DetectAsync has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
CryptoShreddingDetector.IsDiscarded (cognitive 23) engine/src/CodeHealth.Core/ModelAware/CryptoShreddingDetector.cs:436— CryptoShreddingDetector.IsDiscarded has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.AddGoDomainInfraLeaks (cognitive 23) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4758— DomainModelAnalyzer.AddGoDomainInfraLeaks has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.EventCommandShape (cognitive 23) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:927— EventDrivenAnalyzer.EventCommandShape has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvocationMatching.FirstMatch (cognitive 23) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:29— InvocationMatching.FirstMatch has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.ConstructorSuppliedDefault (cognitive 23) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:2929— LogicDefectAnalyzer.ConstructorSuppliedDefault has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustDomainConventions.RustDualWrites (cognitive 23) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:905— RustDomainConventions.RustDualWrites has cognitive complexity 23 (threshold 15). Of this number, 18 points are the body's own statements and 5 belong to 5 function literals inside it that branch. 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.
DartAnalyzerExclusions.ParseExcludes (cognitive 23) engine/src/CodeHealth.Core/Readiness/DartAnalyzerExclusions.cs:224— DartAnalyzerExclusions.ParseExcludes has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.CiGateHonesty (cognitive 23) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:108— ProductionReadinessAnalyzer.CiGateHonesty has cognitive complexity 23 (threshold 15). 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.
DiskSourceFiles.DominantJavaScriptExtension (cognitive 23) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:118— DiskSourceFiles.DominantJavaScriptExtension has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.ParseXml (cognitive 23) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:433— CommittedCoverageReader.ParseXml has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.MergeLcovPerFile (cognitive 23) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1042— CommittedCoverageReader.MergeLcovPerFile has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonTestCensus.PythonTestFiles (cognitive 23) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:374— PythonTestCensus.PythonTestFiles has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynTestQualityCollector.IsFetchArgument (cognitive 23) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:905— RoslynTestQualityCollector.IsFetchArgument has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SelfDeclaredUnreliableTests.EnumerateTestFiles (cognitive 23) engine/src/CodeHealth.Core/Testing/SelfDeclaredUnreliableTests.cs:264— SelfDeclaredUnreliableTests.EnumerateTestFiles has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ReportViewModelFactory.DeterministicBusinessBrief (cognitive 23) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:367— ReportViewModelFactory.DeterministicBusinessBrief has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildTimeKeyMaterialScan.GeneratedKeys (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:240— BuildTimeKeyMaterialScan.GeneratedKeys has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CargoAuditWaivers.Read (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/CargoAuditWaivers.cs:26— CargoAuditWaivers.Read has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsRegexCaptureGroupRecheck.ReadRegexLiteralSpan (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs:274— JsRegexCaptureGroupRecheck.ReadRegexLiteralSpan has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsSiblingScopeReadScan.FindingsIn (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:167— JsSiblingScopeReadScan.FindingsIn has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrimaryConstructorShadow.Blank (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:197— PrimaryConstructorShadow.Blank has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ScanParsers.TrivyFindings (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:884— ScanParsers.TrivyFindings has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SemgrepShapeFilter.IsUnreachableClaim (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepShapeFilter.cs:102— SemgrepShapeFilter.IsUnreachableClaim has cognitive complexity 23 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
UnpinnedToolchainInstallScan.CargoOffence (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/UnpinnedToolchainInstallScan.cs:511— UnpinnedToolchainInstallScan.CargoOffence has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VendoredManifestScope.IsInDeclaredWorkspace (cognitive 23) engine/src/CodeHealth.Dimensions.Security/Scanners/VendoredManifestScope.cs:339— VendoredManifestScope.IsInDeclaredWorkspace has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretsHistoryAnalyzer.RustDocCommentRegions (cognitive 23) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:838— SecretsHistoryAnalyzer.RustDocCommentRegions has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ReadCiInvokedScripts (cognitive 23) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5791— SupplyChainProvenanceAnalyzer.ReadCiInvokedScripts has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.DetectCliques (cognitive 23) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:1171— ChangeCouplingAnalyzer.DetectCliques has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JvmProvider.BuildProjects (cognitive 23) engine/src/CodeHealth.CodeModel.Jvm/JvmProvider.cs:681— JvmProvider.BuildProjects has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scope-evidence._version_stamps (cognitive 23) tools/train/scope-evidence.py:194— scope-evidence._version_stamps has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), error handling 2 (7 pts), loops 2 (3 pts), boolean chains 2 (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.
TokenSink::walk (cognitive 23) engine/sidecars/rust-frontend/src/main.rs:4780— TokenSink::walk has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
extract-file.typeEmitters (cognitive 23) engine/sidecars/tsjs-frontend/extract-file.mjs:338— extract-file.typeEmitters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, error handling 1 (4 pts), loops 3 (4 pts), ternaries 1 (nesting depth added 8). Most of this is not in the body itself: 0 of the 23 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 367, 385, 340, …). 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.
(anonymous) (cognitive 23) src/Kennel.Ui/wwwroot/kennel-ui.js:1701— (anonymous) has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, ternaries 2 (3 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (apply, wire, initScansFilter, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
discoverSurfaces (cognitive 23) engine/docker/analyzer/render/axe-render.mjs:76— discoverSurfaces has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, error handling 1 (3 pts), loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 10). Of this number, 14 points are the body's own statements and 9 belong to 4 function items inside it that branch. 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.
VbBranchExtractor.Walk (cognitive 22) engine/src/CodeHealth.Core/CodeModel/Roslyn/VbBranchExtractor.cs:50— VbBranchExtractor.Walk has cognitive complexity 22 (threshold 15). 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.
RoslynDuplicationDetector.AppendRenameClones (cognitive 22) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2573— RoslynDuplicationDetector.AppendRenameClones has cognitive complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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.
RustInlineTestRegions.FindItemEnd (cognitive 22) engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:182— RustInlineTestRegions.FindItemEnd has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.C3 (cognitive 22) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5270— ComplianceSecurityAnalyzer.C3 has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoModuleHygiene.ParseModule (cognitive 22) engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:371— GoModuleHygiene.ParseModule has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HexCurrencyCollector.CollectAsync (cognitive 22) engine/src/CodeHealth.Core/Dependencies/HexCurrencyCollector.cs:32— HexCurrencyCollector.CollectAsync has cognitive complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MavenManifestHygiene.ReadVersionCatalogue (cognitive 22) engine/src/CodeHealth.Core/Dependencies/MavenManifestHygiene.cs:283— MavenManifestHygiene.ReadVersionCatalogue has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftPackageHygiene.ParseDependencies (cognitive 22) engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:421— SwiftPackageHygiene.ParseDependencies has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnityRegistryClient.Parse (cognitive 22) engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:216— UnityRegistryClient.Parse has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VbaSourcePresence.IsVbaTree (cognitive 22) engine/src/CodeHealth.Core/Discovery/VbaSourcePresence.cs:47— VbaSourcePresence.IsVbaTree has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorCodeBlockProjection.CodeBlockBodies (cognitive 22) engine/src/CodeHealth.Core/ExplicitDebt/RazorCodeBlockProjection.cs:106— RazorCodeBlockProjection.CodeBlockBodies has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorGeneratedDocumentSynthesizer.TemplateEnd (cognitive 22) engine/src/CodeHealth.Core/ExplicitDebt/RazorGeneratedDocumentSynthesizer.cs:391— RazorGeneratedDocumentSynthesizer.TemplateEnd has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.ExtractScriptPaths (cognitive 22) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1867— EntryPointCatalog.ExtractScriptPaths has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.GitignoreDisownsPath (cognitive 22) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:702— FrontendDeadCode.GitignoreDisownsPath has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeclaredPackageRefs.CollectManifestSelfConfiguredPackages (cognitive 22) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:313— FrontendDeclaredPackageRefs.CollectManifestSelfConfiguredPackages has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.BuildUsageByManifest (cognitive 22) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:2604— FrontendDependencyHygiene.BuildUsageByManifest has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.CollectDynamicSpecifierPackages (cognitive 22) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:24— FrontendSpecifierScanning.CollectDynamicSpecifierPackages has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendToolAndRuntimeRefs.CollectManifestScriptFilePaths (cognitive 22) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:506— FrontendToolAndRuntimeRefs.CollectManifestScriptFilePaths has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsCloneNearExactness.IsNearExactEnoughToPublish (cognitive 22) engine/src/CodeHealth.Core/Frontend/JsCloneNearExactness.cs:270— JsCloneNearExactness.IsNearExactEnoughToPublish has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.RecogniseDeclarationRun (cognitive 22) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:1841— JsDuplicationDetector.RecogniseDeclarationRun has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.MergeContiguousRuns (cognitive 22) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5812— JsDuplicationDetector.MergeContiguousRuns has cognitive complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 2 function literals inside it that branch. 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.
JsRedundantReDefault.IsRedundantAt (cognitive 22) engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs:67— JsRedundantReDefault.IsRedundantAt has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsStringConstants.EvaluateExpression (cognitive 22) engine/src/CodeHealth.Core/Frontend/JsStringConstants.cs:206— JsStringConstants.EvaluateExpression has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MinifiedJsHeuristics.LooksMinified (cognitive 22) engine/src/CodeHealth.Core/Frontend/MinifiedJsHeuristics.cs:565— MinifiedJsHeuristics.LooksMinified has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CssInJsContrast (cognitive 22) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6023— AccessibilityAnalyzer.CssInJsContrast has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsprojReferenceGraph.AncestorConditionedGroups (cognitive 22) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:582— CsprojReferenceGraph.AncestorConditionedGroups has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DomainModelAnalyzer.MutableEntities (cognitive 22) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1066— DomainModelAnalyzer.MutableEntities has cognitive complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
InvocationMatching.FirstMatch (cognitive 22) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:97— InvocationMatching.FirstMatch has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.AnalyzeAsync (cognitive 22) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:89— LogicDefectAnalyzer.AnalyzeAsync has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
PipelineVersionOutputScan.StepContext (cognitive 22) engine/src/CodeHealth.Core/Readiness/PipelineVersionOutputScan.cs:245— PipelineVersionOutputScan.StepContext has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.OrchestratorScriptText (cognitive 22) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3956— ProductionReadinessAnalyzer.OrchestratorScriptText has cognitive complexity 22 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.RunsStaticAnalysisViaBuildTarget (cognitive 22) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7409— ProductionReadinessAnalyzer.RunsStaticAnalysisViaBuildTarget has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodebaseSize.FromProjectsAsync (cognitive 22) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:131— CodebaseSize.FromProjectsAsync has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodebaseValuator.Compute (cognitive 22) engine/src/CodeHealth.Core/Scoring/CodebaseValuation.cs:59— CodebaseValuator.Compute has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.MergePerFile (cognitive 22) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:853— CommittedCoverageReader.MergePerFile has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.RunAsync (cognitive 22) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:25— DuplicationAnalyzer.RunAsync has cognitive complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LicenseComplianceAnalyzer.RunAsync (cognitive 22) engine/src/CodeHealth.Dimensions.Security/LicenseComplianceAnalyzer.cs:25— LicenseComplianceAnalyzer.RunAsync has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigMapContentRuleFilter.JudgedNoKeyName (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigMapContentRuleFilter.cs:63— ConfigMapContentRuleFilter.JudgedNoKeyName has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.ParseGoMod (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1837— DeclaredDependencies.ParseGoMod has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.GoAffectedImports (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3269— ScanParsers.GoAffectedImports has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.OsvFixedCandidates (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:3377— ScanParsers.OsvFixedCandidates has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SocketAndUpgradeRecheck.CompositeLiteralSetsField (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/SocketAndUpgradeRecheck.cs:212— SocketAndUpgradeRecheck.CompositeLiteralSetsField has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnpinnedToolchainInstallScan.NodeOffence (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/UnpinnedToolchainInstallScan.cs:413— UnpinnedToolchainInstallScan.NodeOffence has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedRemoteInstallerScan.FetchHelpers (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:492— UnverifiedRemoteInstallerScan.FetchHelpers has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorldWritableOwnedPathScan.FindingsIn (cognitive 22) engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:90— WorldWritableOwnedPathScan.FindingsIn has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.IdentityDefectIn (cognitive 22) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingIdentity.cs:154— SupplyChainProvenanceAnalyzer.IdentityDefectIn has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ParseMakefile (cognitive 22) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleasePathReach.cs:138— SupplyChainProvenanceAnalyzer.ParseMakefile has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UninvokedGoReleaserManifest (cognitive 22) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleaseTrigger.cs:88— SupplyChainProvenanceAnalyzer.UninvokedGoReleaserManifest has cognitive complexity 22 (threshold 15). 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.
LlmAdrEvaluator.EvaluateQualityAsync (cognitive 22) engine/src/CodeHealth.Dimensions.Docs/Llm/LlmAdrEvaluator.cs:34— LlmAdrEvaluator.EvaluateQualityAsync has cognitive complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to one function literal inside it that branches (line 49). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
DecisionReportsList.razor › LoadGalleryAsync (cognitive 22) src/Kennel.Assay.Core/DecisionReports/Ui/DecisionReportsList.razor:309— DecisionReportsList.razor › LoadGalleryAsync has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FSharpBody.flatTokens (cognitive 22) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:420— FSharpBody.flatTokens has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-corpus.sample (cognitive 22) tools/llm-bakeoff/build-corpus.py:20— build-corpus.sample has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), error handling 1 (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.
build-sweep-corpus.sample (cognitive 22) tools/llm-bakeoff/build-sweep-corpus.py:20— build-sweep-corpus.sample has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), error handling 1 (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.
corpus.discover (cognitive 22) tools/multilang/corpus.py:40— corpus.discover has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dod_gate.main (cognitive 22) tools/multilang/dod_gate.py:27— dod_gate.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 4, ternaries 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
evidence-ab.flips (cognitive 22) tools/train/evidence-ab.py:240— evidence-ab.flips has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 3 (5 pts), boolean chains 4, 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.
judge-k3-report.render_markdown (cognitive 22) tools/train/judge-k3-report.py:360— judge-k3-report.render_markdown has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (9 pts), loops 5 (8 pts), if/else 3, boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
report_detection_delta.main (cognitive 22) tools/train/report_detection_delta.py:419— report_detection_delta.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3, loops 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
sidecarlib._sidecar_details (cognitive 22) tools/train/sidecarlib.py:71— sidecarlib._sidecar_details has cognitive complexity 22 (threshold 15). Drivers by points: loops 5 (15 pts), boolean chains 3, error handling 1 (3 pts), if/else 1 (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BranchWalker.scanExpr (cognitive 22) engine/sidecars/php-frontend/body.php:160— BranchWalker.scanExpr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bodyResolver.recoverCatchOf (cognitive 22) engine/sidecars/go/bodyshapes.go:468— bodyResolver.recoverCatchOf has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 472, 502). 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.
extractor.addPackageValues (cognitive 22) engine/sidecars/go/extract.go:455— extractor.addPackageValues has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSharpCloneTokenizer.CollectUnrolledSequenceSpans (cognitive 21) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:319— CSharpCloneTokenizer.CollectUnrolledSequenceSpans has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralFileLengthScanner.SignificantLineCount (cognitive 21) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:881— NeutralFileLengthScanner.SignificantLineCount has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Subsumption.Implies (cognitive 21) engine/src/CodeHealth.Core/CodeShape/Subsumption.cs:46— Subsumption.Implies has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmVersion.ComparePrerelease (cognitive 21) engine/src/CodeHealth.Core/Dependencies/NpmVersion.cs:92— NpmVersion.ComparePrerelease has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RubyGemsCurrencyCollector.CollectAsync (cognitive 21) engine/src/CodeHealth.Core/Dependencies/RubyGemsCurrencyCollector.cs:84— RubyGemsCurrencyCollector.CollectAsync has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.DeclaredEntryTargetsAllAbsent (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:652— FrontendDependencyHygiene.DeclaredEntryTargetsAllAbsent has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendManifestEntryPoints.AddMiniProgramComponents (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:387— FrontendManifestEntryPoints.AddMiniProgramComponents has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.CollectDeployConfigEntries (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:11— FrontendScriptCommandRefs.CollectDeployConfigEntries has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestAndDocRefs.CollectScriptTestIncludeGlobs (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendTestAndDocRefs.cs:250— FrontendTestAndDocRefs.CollectScriptTestIncludeGlobs has cognitive complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
FrontendWorkspaceLoader.CollectBuildOutputSourceMaps (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceLoader.BuildOutput.cs:39— FrontendWorkspaceLoader.CollectBuildOutputSourceMaps has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendWorkspaceWalk.Walk (cognitive 21) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:251— FrontendWorkspaceWalk.Walk has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.MatchWholesale (cognitive 21) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5297— JsDuplicationDetector.MatchWholesale has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BuildDeclarationHeads (cognitive 21) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:6368— JsDuplicationDetector.BuildDeclarationHeads has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.DestructuredAwaitSymbols (cognitive 21) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:590— ModuleSyntaxScanner.DestructuredAwaitSymbols has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.ComposerPsr4Separation (cognitive 21) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2592— MaturityAnalyzer.ComposerPsr4Separation has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.ConditionalToggleStateUnexposed (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4302— AccessibilityAnalyzer.ConditionalToggleStateUnexposed has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.EnumerateBuildStepCandidates (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5828— AccessibilityAnalyzer.EnumerateBuildStepCandidates has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.EnumerateScriptFiles (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6212— AccessibilityAnalyzer.EnumerateScriptFiles has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.AppAssignsDocumentTitleAtRuntime (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7888— AccessibilityAnalyzer.AppAssignsDocumentTitleAtRuntime has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CountUnreadTemplateLanguageMarkup (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:167— AccessibilityAnalyzer.CountUnreadTemplateLanguageMarkup has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllowlistGate.Match (cognitive 21) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:276— AllowlistGate.Match has cognitive complexity 21 (threshold 15). 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.
CoherenceSmellAnalyzer.Implies (cognitive 21) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:335— CoherenceSmellAnalyzer.Implies has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CqsAnalyzer.AnalyzeNeutralAsync (cognitive 21) engine/src/CodeHealth.Core/ModelAware/CqsAnalyzer.cs:193— CqsAnalyzer.AnalyzeNeutralAsync has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DomainModelAnalyzer.DomainReferencesInfrastructure (cognitive 21) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4592— DomainModelAnalyzer.DomainReferencesInfrastructure has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnvironmentSeparationAnalyzer.FindEnvConfigs (cognitive 21) engine/src/CodeHealth.Core/ModelAware/EnvironmentSeparationAnalyzer.cs:269— EnvironmentSeparationAnalyzer.FindEnvConfigs has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventSourcingAnalyzer.FoldDeterminism (cognitive 21) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:641— EventSourcingAnalyzer.FoldDeterminism has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDomainConventions.MutatesOwnState (cognitive 21) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:2358— GoDomainConventions.MutatesOwnState has cognitive complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
GoDomainConventions.ReferencesImport (cognitive 21) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:2733— GoDomainConventions.ReferencesImport has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.UsageExampleCommentLines (cognitive 21) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3579— IncompletenessAnalyzer.UsageExampleCommentLines has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RubyDomainConventions.IsRubyDomainCommand (cognitive 21) engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:224— RubyDomainConventions.IsRubyDomainCommand has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeModelTestCensus.SkipReason (cognitive 21) engine/src/CodeHealth.Core/Testing/CodeModelTestCensus.cs:309— CodeModelTestCensus.SkipReason has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.ParseGoCoverProfile (cognitive 21) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:343— CommittedCoverageReader.ParseGoCoverProfile has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.ParseJsonCoverage (cognitive 21) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:591— CommittedCoverageReader.ParseJsonCoverage has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoTestCensus.ModuleOf (cognitive 21) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:361— GoTestCensus.ModuleOf has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
JsTestCensus.PackageOf (cognitive 21) engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:230— JsTestCensus.PackageOf has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NodeTestSuiteProbe.ChooseRunner (cognitive 21) engine/src/CodeHealth.Core/Testing/NodeTestSuiteProbe.cs:466— NodeTestSuiteProbe.ChooseRunner has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PythonTestCensus.Strip (cognitive 21) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:161— PythonTestCensus.Strip has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
PythonTestCensus.DistributionOf (cognitive 21) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:259— PythonTestCensus.DistributionOf has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RoslynTestQualityCollector.HasCommentedOutAssertion (cognitive 21) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1467— RoslynTestQualityCollector.HasCommentedOutAssertion has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynTestQualityCollector.CollectAssertingTypeNames (cognitive 21) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1870— RoslynTestQualityCollector.CollectAssertingTypeNames has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynTestQualityCollector.DetectSwallowedFailure (cognitive 21) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:2035— RoslynTestQualityCollector.DetectSwallowedFailure has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustTestCensus.CrateOf (cognitive 21) engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:338— RustTestCensus.CrateOf has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MailmapIdentityMap.Load (cognitive 21) engine/src/CodeHealth.Toolchain/Git/MailmapIdentityMap.cs:33— MailmapIdentityMap.Load has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AnalyzeCommand.SelectPrimaryNeutralModel (cognitive 21) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:3553— AnalyzeCommand.SelectPrimaryNeutralModel has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeSetBuilder.SplitCluster (cognitive 21) engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:1046— ChangeSetBuilder.SplitCluster has cognitive complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.OmissionBetween (cognitive 21) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2412— DuplicationAnalyzer.OmissionBetween has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.AddBoundNames (cognitive 21) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2749— DuplicationAnalyzer.AddBoundNames has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyVulnerabilityUnion.CollapsePerPackage (cognitive 21) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:114— DependencyVulnerabilityUnion.CollapsePerPackage has cognitive complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
BrowserSandboxDisabledScan.EnvAssignments (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:373— BrowserSandboxDisabledScan.EnvAssignments has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenericDecodeAdviceRecheck.GenericValueDecodeInto (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/GenericDecodeAdviceRecheck.cs:103— GenericDecodeAdviceRecheck.GenericValueDecodeInto has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamelessWorkloadNormalisedScan.RescanAsync (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadNormalisedScan.cs:89— NamelessWorkloadNormalisedScan.RescanAsync has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceScopedRuleAggregator.KustomizationScope (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/NamespaceScopedRuleAggregator.cs:155— NamespaceScopedRuleAggregator.KustomizationScope has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResponseWriteRequestTextRecheck.IsStringLiteralsOnly (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/ResponseWriteRequestTextRecheck.cs:264— ResponseWriteRequestTextRecheck.IsStringLiteralsOnly has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShellExecRecheck.JsChildProcessHasNoShell (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/ShellExecRecheck.cs:161— ShellExecRecheck.JsChildProcessHasNoShell has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowTriggerRecheck.FindWorkflowByName (cognitive 21) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowTriggerRecheck.cs:157— WorkflowTriggerRecheck.FindWorkflowByName has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.SecretArgvSites (cognitive 21) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9275— SupplyChainProvenanceAnalyzer.SecretArgvSites has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.DeclaredPackagingScripts (cognitive 21) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingReach.cs:37— SupplyChainProvenanceAnalyzer.DeclaredPackagingScripts has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
KnowledgeDecayModel.LastSubstantiveAuthorStillActive (cognitive 21) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeDecayModel.cs:524— KnowledgeDecayModel.LastSubstantiveAuthorStillActive has cognitive complexity 21 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FileExtractor._classify_bases (cognitive 21) engine/sidecars/python-frontend/main.py:232— FileExtractor._classify_bases has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verified_history.append_verified_history (cognitive 21) tools/depthnoise/verified_history.py:99— verified_history.append_verified_history has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 7, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
expand_corpus.main (cognitive 21) tools/multilang/expand_corpus.py:179— expand_corpus.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (5 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan._shipped_sources (cognitive 21) tools/multilang/scan.py:261— scan._shipped_sources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 2 (4 pts), boolean chains 1, ternaries 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.
judge-kpass-merge.main (cognitive 21) tools/train/judge-kpass-merge.py:63— judge-kpass-merge.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 5 (6 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.
production_untouched.main (cognitive 21) tools/train/production_untouched.py:139— production_untouched.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 5 (8 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
programme-status.duplicate_pair_agreement (cognitive 21) tools/train/programme-status.py:330— programme-status.duplicate_pair_agreement has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 3 (6 pts), ternaries 1 (4 pts), boolean chains 3 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sample-by-kind.main (cognitive 21) tools/train/sample-by-kind.py:64— sample-by-kind.main has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (10 pts), if/else 7 (8 pts), ternaries 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.
ts-helpers.walk (cognitive 21) engine/sidecars/tsjs-frontend/ts-helpers.mjs:264— ts-helpers.walk has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 2, error handling 1, loops 1, ternaries 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.
ElixirDoctest.DoctestSpans (cognitive 20) engine/src/CodeHealth.Core/Classification/ElixirDoctest.cs:68— ElixirDoctest.DoctestSpans has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.ScanItemDelimiters (cognitive 20) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:1300— SourceClassifier.ScanItemDelimiters has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynVbMethodBody.StripCommentsAndStrings (cognitive 20) engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynVbMethodBody.cs:239— RoslynVbMethodBody.StripCommentsAndStrings has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralMethodLengthScanner.Scan (cognitive 20) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:64— NeutralMethodLengthScanner.Scan has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralMethodLengthScanner.BodyExtent (cognitive 20) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:140— NeutralMethodLengthScanner.BodyExtent has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorCodeVirtualizer.SkipString (cognitive 20) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:281— RazorCodeVirtualizer.SkipString has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ControlFlowComplexity.DominantShape (cognitive 20) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:168— ControlFlowComplexity.DominantShape has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectNamedPolicyEnums (cognitive 20) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4395— ComplianceSecurityAnalyzer.DetectNamedPolicyEnums has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedHttpSurfaceScan.Enumerate (cognitive 20) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:441— HostedHttpSurfaceScan.Enumerate has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendAnalyzer.Score (cognitive 20) engine/src/CodeHealth.Core/Discovery/FrontendAnalyzer.cs:526— FrontendAnalyzer.Score has cognitive complexity 20 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MarkdownSnippetReferenceScanner.CollectHostFilesAsync (cognitive 20) engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:79— MarkdownSnippetReferenceScanner.CollectHostFilesAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorGeneratedDocumentSynthesizer.CollectBoundReferencesAsync (cognitive 20) engine/src/CodeHealth.Core/ExplicitDebt/RazorGeneratedDocumentSynthesizer.cs:101— RazorGeneratedDocumentSynthesizer.CollectBoundReferencesAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDeadCodeDetector.IsReflectivelyRegistered (cognitive 20) engine/src/CodeHealth.Core/ExplicitDebt/RoslynDeadCodeDetector.cs:780— RoslynDeadCodeDetector.IsReflectivelyRegistered has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnloadedSourceReferenceScanner.Collect (cognitive 20) engine/src/CodeHealth.Core/ExplicitDebt/UnloadedSourceReferenceScanner.cs:48— UnloadedSourceReferenceScanner.Collect has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DirectoryBarrelRefs.CollectEdges (cognitive 20) engine/src/CodeHealth.Core/Frontend/DirectoryBarrelRefs.cs:57— DirectoryBarrelRefs.CollectEdges has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.AddFileRoutedTrees (cognitive 20) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:1422— EntryPointCatalog.AddFileRoutedTrees has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.DeclaredWorkspaceMemberDirectories (cognitive 20) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1877— FrontendBoundaries.DeclaredWorkspaceMemberDirectories has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendManifestEntryPoints.AddRegistryFiles (cognitive 20) engine/src/CodeHealth.Core/Frontend/FrontendManifestEntryPoints.cs:212— FrontendManifestEntryPoints.AddRegistryFiles has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestSuiteMasking.CollectRunnerSetupSiblingRefs (cognitive 20) engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:871— FrontendTestSuiteMasking.CollectRunnerSetupSiblingRefs has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.IsSpecialisationDelegationRun (cognitive 20) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:3702— JsDuplicationDetector.IsSpecialisationDelegationRun has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.ScanRegex (cognitive 20) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:687— Scanner.ScanRegex has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.PubPackageLayoutSeparation (cognitive 20) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2544— MaturityAnalyzer.PubPackageLayoutSeparation has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
MaturityAnalyzer.EnumerateJvmModuleDirs (cognitive 20) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2719— MaturityAnalyzer.EnumerateJvmModuleDirs has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.TailwindContrast (cognitive 20) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5245— AccessibilityAnalyzer.TailwindContrast has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CollectTaggedTemplateMarkup (cognitive 20) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs:236— AccessibilityAnalyzer.CollectTaggedTemplateMarkup has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConstructibleInvalidStateAnalyzer.Analyze (cognitive 20) engine/src/CodeHealth.Core/ModelAware/ConstructibleInvalidStateAnalyzer.cs:65— ConstructibleInvalidStateAnalyzer.Analyze has cognitive complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 4 function literals inside it that branch. 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.
DomainModelAnalyzer.AggregateBoundaries (cognitive 20) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:668— DomainModelAnalyzer.AggregateBoundaries has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDomainConventions.CrossContextReferenceIdFields (cognitive 20) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:3015— GoDomainConventions.CrossContextReferenceIdFields has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.FlagStateAt (cognitive 20) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:2778— LogicDefectAnalyzer.FlagStateAt has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelAwareLlmJudge.SelectYesAsync (cognitive 20) engine/src/CodeHealth.Core/ModelAware/ModelAwareLlmJudge.cs:294— ModelAwareLlmJudge.SelectYesAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModelAwareLlmJudge.ResolveId (cognitive 20) engine/src/CodeHealth.Core/ModelAware/ModelAwareLlmJudge.cs:589— ModelAwareLlmJudge.ResolveId has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PerformanceAnalyzer.DiscoverBenchmarksOnDisk (cognitive 20) engine/src/CodeHealth.Core/ModelAware/PerformanceAnalyzer.cs:496— PerformanceAnalyzer.DiscoverBenchmarksOnDisk has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScalaDomainConventions.AnemicEntities (cognitive 20) engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:856— ScalaDomainConventions.AnemicEntities has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecurityDefectAnalyzer.AnalyzeAsync (cognitive 20) engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:160— SecurityDefectAnalyzer.AnalyzeAsync has cognitive complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StringContractSmellAnalyzer.ResolveContracts (cognitive 20) engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:239— StringContractSmellAnalyzer.ResolveContracts has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PipelineVersionOutputScan.ScanWorkflow (cognitive 20) engine/src/CodeHealth.Core/Readiness/PipelineVersionOutputScan.cs:129— PipelineVersionOutputScan.ScanWorkflow has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotnetProjectLicensesCollector.FilterToProductPackages (cognitive 20) engine/src/CodeHealth.Core/Security/DotnetProjectLicensesCollector.cs:132— DotnetProjectLicensesCollector.FilterToProductPackages has cognitive complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
XmlProjectGraphBuilder.EmbeddedProjectFiles (cognitive 20) engine/src/CodeHealth.Core/Statistics/XmlProjectGraphBuilder.cs:239— XmlProjectGraphBuilder.EmbeddedProjectFiles has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.HasRustInlineTestSuite (cognitive 20) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:725— DiskTestScanner.HasRustInlineTestSuite has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.DeclaresJsTestRunner (cognitive 20) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1031— DiskTestScanner.DeclaresJsTestRunner has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeTestSuiteProbe.DeclaredOnPathToRoot (cognitive 20) engine/src/CodeHealth.Core/Testing/NodeTestSuiteProbe.cs:334— NodeTestSuiteProbe.DeclaredOnPathToRoot has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
PreprocessorTestRegions.HandleDirective (cognitive 20) engine/src/CodeHealth.Core/Testing/PreprocessorTestRegions.cs:136— PreprocessorTestRegions.HandleDirective has cognitive complexity 20 (threshold 15). 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.
XPlatCollectorProbe.EnumerateBuildFiles (cognitive 20) engine/src/CodeHealth.Core/Testing/XPlatCollectorProbe.cs:186— XPlatCollectorProbe.EnumerateBuildFiles has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartialLoadDiagnosticsReport.Render (cognitive 20) engine/src/CodeHealth.Cli/Diagnostics/PartialLoadDiagnosticsReport.cs:118— PartialLoadDiagnosticsReport.Render has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DsmHtml.AppendTable (cognitive 20) engine/src/CodeHealth.Reporting/Architecture/DsmHtml.cs:133— DsmHtml.AppendTable has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileQualityScorer.Score (cognitive 20) engine/src/CodeHealth.Reporting/FileQuality/FileQualityScorer.cs:68— FileQualityScorer.Score has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProjectCohesionAnalyzer.RunAsync (cognitive 20) engine/src/CodeHealth.Dimensions.Architecture/ProjectCohesionAnalyzer.cs:38— ProjectCohesionAnalyzer.RunAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GodClassAnalyzer.SignificantJsLineCount (cognitive 20) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/GodClassAnalyzer.cs:922— GodClassAnalyzer.SignificantJsLineCount has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplexityScoring.BuildResult (cognitive 20) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/ComplexityScoring.cs:831— ComplexityScoring.BuildResult has cognitive complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to one function literal inside it that branches. 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.
IlEfficiencyAnalyzer.RunAsync (cognitive 20) engine/src/CodeHealth.Dimensions.CodeQuality/IlEfficiencyAnalyzer.cs:35— IlEfficiencyAnalyzer.RunAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CargoLockGraph.GitPinnedGateAbove (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:340— CargoLockGraph.GitPinnedGateAbove has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeclaredDependencies.FromRepository (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:768— DeclaredDependencies.FromRepository has cognitive complexity 20 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
KsvSecurityContextAggregator.Collapse (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/KsvSecurityContextAggregator.cs:53— KsvSecurityContextAggregator.Collapse has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupEscapingRecheck.ScanModuleForHtmlEscapingTemplate (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:688— MarkupEscapingRecheck.ScanModuleForHtmlEscapingTemplate has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoOpToolShimScan.SplitRedirect (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:281— NoOpToolShimScan.SplitRedirect has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OsvScannerIgnores.Parse (cognitive 20) engine/src/CodeHealth.Dimensions.Security/Scanners/OsvScannerIgnores.cs:244— OsvScannerIgnores.Parse has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.EnumerateManifestCandidates (cognitive 20) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5080— SupplyChainProvenanceAnalyzer.EnumerateManifestCandidates has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.LineLeaksCredentialInArgv (cognitive 20) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9818— SupplyChainProvenanceAnalyzer.LineLeaksCredentialInArgv has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.IsStringCatalogueFile (cognitive 20) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2446— ChangeCouplingAnalyzer.IsStringCatalogueFile has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitMiningSourceFiles.IsConstantEnumerationText (cognitive 20) engine/src/CodeHealth.Dimensions.GitMining/GitMiningSourceFiles.cs:718— GitMiningSourceFiles.IsConstantEnumerationText has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CoverageAnalyzer.PolyglotUnmeasured (cognitive 20) engine/src/CodeHealth.Dimensions.Testing/CoverageAnalyzer.cs:1267— CoverageAnalyzer.PolyglotUnmeasured has cognitive complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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.
FSharpSyntaxModel.typeDefnOf (cognitive 20) engine/src/CodeHealth.CodeModel.FSharp/SyntaxModel.fs:480— FSharpSyntaxModel.typeDefnOf has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (17 pts), if/else 2, boolean chains 1 (nesting depth added 11). 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.
highconc-sweep.main (cognitive 20) tools/llm-bakeoff/highconc-sweep.py:43— highconc-sweep.main has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 4 (7 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build_onboard_manifest.main (cognitive 20) tools/multilang/build_onboard_manifest.py:79— build_onboard_manifest.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 5, loops 4 (5 pts), ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
scan.warn_image_stale (cognitive 20) tools/multilang/scan.py:302— scan.warn_image_stale has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), ternaries 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
census.audit (cognitive 20) tools/rescan/census.py:136— census.audit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
adjudication.main (cognitive 20) tools/train/adjudication.py:339— adjudication.main has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 5, boolean chains 4, error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge_assignment.render_markdown (cognitive 20) tools/train/judge_assignment.py:1626— judge_assignment.render_markdown has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 5, boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
maturity.main (cognitive 20) tools/train/maturity.py:57— maturity.main has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 5, if/else 2 (3 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.
scope-evidence.project_contents_evidence (cognitive 20) tools/train/scope-evidence.py:561— scope-evidence.project_contents_evidence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 1 (3 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SymbolCollector.enterNode (cognitive 20) engine/sidecars/php-frontend/main.php:141— SymbolCollector.enterNode has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, if/else 5 (6 pts), ternaries 2 (4 pts), loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.dataLiteralMaskOver (cognitive 20) engine/sidecars/go/bodylines.go:306— main.dataLiteralMaskOver has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 4 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 337, 322). 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.
extractor.computeImplements (cognitive 20) engine/sidecars/go/implements.go:39— extractor.computeImplements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BodyVisitor::walk_select_arms (cognitive 20) engine/sidecars/rust-frontend/src/main.rs:3726— BodyVisitor::walk_select_arms has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), match/switch 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.
AggregateSiblingContexts.Detect (cognitive 19) engine/src/CodeHealth.Core/Architecture/AggregateSiblingContexts.cs:72— AggregateSiblingContexts.Detect has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ContainerDetector.BuildAsync (cognitive 19) engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:15— ContainerDetector.BuildAsync has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ContainerDetector.HostKind (cognitive 19) engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:123— ContainerDetector.HostKind has cognitive complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RepoTopologyScanner.EnumerateFiles (cognitive 19) engine/src/CodeHealth.Core/Architecture/Topology/RepoTopologyScanner.cs:92— RepoTopologyScanner.EnumerateFiles has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.CountCatalogueLines (cognitive 19) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:1336— SourceClassifier.CountCatalogueLines has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.PackageJsonVerdict (cognitive 19) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3473— SourceClassifier.PackageJsonVerdict has cognitive complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
NeutralGodClassScanner.Scan (cognitive 19) engine/src/CodeHealth.Core/CodeShape/NeutralGodClassScanner.cs:1011— NeutralGodClassScanner.Scan has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralMethodLengthScanner.ReadSignature (cognitive 19) engine/src/CodeHealth.Core/CodeShape/NeutralMethodLengthScanner.cs:216— NeutralMethodLengthScanner.ReadSignature has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ComplianceSecurityAnalyzer.ScanWeakKdfWorkFactor (cognitive 19) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2892— ComplianceSecurityAnalyzer.ScanWeakKdfWorkFactor has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanWeakHashTrustGates (cognitive 19) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3642— ComplianceSecurityAnalyzer.ScanWeakHashTrustGates has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostedHttpSurfaceScan.Scan (cognitive 19) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:262— HostedHttpSurfaceScan.Scan has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HexRegistryClient.Parse (cognitive 19) engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:202— HexRegistryClient.Parse has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnityCurrencyCollector.CollectAsync (cognitive 19) engine/src/CodeHealth.Core/Dependencies/UnityCurrencyCollector.cs:36— UnityCurrencyCollector.CollectAsync has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileSystemDocumentationCollector.MeasureCoverageAsync (cognitive 19) engine/src/CodeHealth.Core/Docs/FileSystemDocumentationCollector.cs:122— FileSystemDocumentationCollector.MeasureCoverageAsync has cognitive complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorGeneratedDocumentSynthesizer.Fork (cognitive 19) engine/src/CodeHealth.Core/ExplicitDebt/RazorGeneratedDocumentSynthesizer.cs:160— RazorGeneratedDocumentSynthesizer.Fork has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorGeneratedDocumentSynthesizer.ReadDirectives (cognitive 19) engine/src/CodeHealth.Core/ExplicitDebt/RazorGeneratedDocumentSynthesizer.cs:454— RazorGeneratedDocumentSynthesizer.ReadDirectives has cognitive complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.SegmentRuns (cognitive 19) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:2442— RoslynExplicitDebtCollector.SegmentRuns has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangelogFiles.IsChangelogFileName (cognitive 19) engine/src/CodeHealth.Core/FileQuality/ChangelogFiles.cs:93— ChangelogFiles.IsChangelogFileName has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneratedRegionScan.Analyse (cognitive 19) engine/src/CodeHealth.Core/FileQuality/GeneratedRegionScan.cs:127— GeneratedRegionScan.Analyse has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpstreamAttribution.ReadOwnDeclarations (cognitive 19) engine/src/CodeHealth.Core/FileQuality/UpstreamAttribution.cs:1669— UpstreamAttribution.ReadOwnDeclarations has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocsSiteTrees.Detect (cognitive 19) engine/src/CodeHealth.Core/Frontend/DocsSiteTrees.cs:38— DocsSiteTrees.Detect has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.DetectTooling (cognitive 19) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:984— EntryPointCatalog.DetectTooling has cognitive complexity 19 (threshold 15). 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.
FirstPartyJs.Enumerate (cognitive 19) engine/src/CodeHealth.Core/Frontend/FirstPartyJs.cs:34— FirstPartyJs.Enumerate has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.ProjectSliceCycles (cognitive 19) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:352— FrontendBoundaries.ProjectSliceCycles has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectLayeredViolations (cognitive 19) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:856— FrontendBoundaries.CollectLayeredViolations has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeadCode.FindEntrylessPackages (cognitive 19) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:441— FrontendDeadCode.FindEntrylessPackages has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeclaredPackageRefs.CollectSourceNamedPluginPackages (cognitive 19) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:496— FrontendDeclaredPackageRefs.CollectSourceNamedPluginPackages has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.IsInsideComment (cognitive 19) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:462— FrontendSpecifierScanning.IsInsideComment has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.OutermostEnclosingCallee (cognitive 19) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:2036— JsDuplicationDetector.OutermostEnclosingCallee has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.TryCollapsePeriodicRun (cognitive 19) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4661— JsDuplicationDetector.TryCollapsePeriodicRun has cognitive complexity 19 (threshold 15). 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.
Scanner.TryScanJsxTypeArguments (cognitive 19) engine/src/CodeHealth.Core/Frontend/JsLexer.Jsx.cs:532— Scanner.TryScanJsxTypeArguments has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.IsFunctionSignatureParen (cognitive 19) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1616— ModuleSyntaxScanner.IsFunctionSignatureParen has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.AppendVerifiableEvidence (cognitive 19) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:185— MaturityAnalyzer.AppendVerifiableEvidence has cognitive complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MaturityAnalyzer.HasPerPackageSrcLayout (cognitive 19) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3109— MaturityAnalyzer.HasPerPackageSrcLayout has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureModelAnalyzer.StatefulSingletons (cognitive 19) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:852— ArchitectureModelAnalyzer.StatefulSingletons has cognitive complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 5 function literals inside it that branch. 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.
ArchitectureModelAnalyzer.RetentionScopes (cognitive 19) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1775— ArchitectureModelAnalyzer.RetentionScopes has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodeCompositionByRoleAnalyzer.AnalyzeAsync (cognitive 19) engine/src/CodeHealth.Core/ModelAware/CodeCompositionByRoleAnalyzer.cs:19— CodeCompositionByRoleAnalyzer.AnalyzeAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDomainConventions.RepositoryContractLeak (cognitive 19) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:1410— GoDomainConventions.RepositoryContractLeak has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.HasSubstantiveSiblingImplementation (cognitive 19) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:2408— IncompletenessAnalyzer.HasSubstantiveSiblingImplementation has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsInteropContractAnalyzer.InlineMarkupScripts (cognitive 19) engine/src/CodeHealth.Core/ModelAware/JsInteropContractAnalyzer.cs:277— JsInteropContractAnalyzer.InlineMarkupScripts has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposePsParser.ParseObjects (cognitive 19) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/ComposePsParser.cs:83— ComposePsParser.ParseObjects has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DevServerDetector.ShallowestPackageJsons (cognitive 19) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:80— DevServerDetector.ShallowestPackageJsons has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.DeclaresNonEmptyUpdateList (cognitive 19) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5584— ProductionReadinessAnalyzer.DeclaresNonEmptyUpdateList has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.ReadAllMatching (cognitive 19) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7753— ProductionReadinessAnalyzer.ReadAllMatching has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PublishedPackageLockfiles.Inspect (cognitive 19) engine/src/CodeHealth.Core/Readiness/PublishedPackageLockfiles.cs:86— PublishedPackageLockfiles.Inspect has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuildlessCSharpProjects.Build (cognitive 19) engine/src/CodeHealth.Core/Roslyn/BuildlessCSharpProjects.cs:176— BuildlessCSharpProjects.Build has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
DiskSourceFiles.FrontendShareCensusAsync (cognitive 19) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:664— DiskSourceFiles.FrontendShareCensusAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.MergeGoCoverProfilePerFile (cognitive 19) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:1111— CommittedCoverageReader.MergeGoCoverProfilePerFile has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeBrowserProvision.ProvisionShim (cognitive 19) engine/src/CodeHealth.Core/Testing/NodeBrowserProvision.cs:161— NodeBrowserProvision.ProvisionShim has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeTestReliabilityCollector.ParseMocha (cognitive 19) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:586— NodeTestReliabilityCollector.ParseMocha has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonTestCensus.BlankString (cognitive 19) engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:209— PythonTestCensus.BlankString has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynTestQualityCollector.AssertionsViaLocalHelpers (cognitive 19) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1706— RoslynTestQualityCollector.AssertionsViaLocalHelpers has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SolutionProjectCaseResolver.Resolve (cognitive 19) engine/src/CodeHealth.Toolchain/Roslyn/SolutionProjectCaseResolver.cs:71— SolutionProjectCaseResolver.Resolve has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DegradedDiagnosticsReport.Walk (cognitive 19) engine/src/CodeHealth.Cli/Diagnostics/DegradedDiagnosticsReport.cs:249— DegradedDiagnosticsReport.Walk has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReportViewModelFactory.BuildDimensionCards (cognitive 19) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:1555— ReportViewModelFactory.BuildDimensionCards has cognitive complexity 19 (threshold 15). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 1556). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
DuplicationAnalyzer.ScrubAnnotationArguments (cognitive 19) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:2015— DuplicationAnalyzer.ScrubAnnotationArguments has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CargoLockGraph.DeclaredEntryAbove (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/CargoLockGraph.cs:408— CargoLockGraph.DeclaredEntryAbove has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockerfileSyntax.Statements (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:74— DockerfileSyntax.Statements has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicateResourceCopyAggregator.Collapse (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:53— DuplicateResourceCopyAggregator.Collapse has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HostPathPersistentVolumeScan.HostPathBacking (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:163— HostPathPersistentVolumeScan.HostPathBacking has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanParsers.SemgrepUnparsedRegions (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs:598— ScanParsers.SemgrepUnparsedRegions has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.RubyFormulaTestBlockRegions (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:4503— SecretNoiseFilter.RubyFormulaTestBlockRegions has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.HelperNeutralises (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:1070— FileModel.HelperNeutralises has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextSentinelConstantIndex.IndexLines (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/TextSentinelConstantIndex.cs:213— TextSentinelConstantIndex.IndexLines has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowInputGateRecheck.AdmitsOnlyShellSafeText (cognitive 19) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:521— WorkflowInputGateRecheck.AdmitsOnlyShellSafeText has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UnpinnedUseSites (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:724— SupplyChainProvenanceAnalyzer.UnpinnedUseSites has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.DirtyPublishSites (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1987— SupplyChainProvenanceAnalyzer.DirtyPublishSites has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.BuildIntegrityArms (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:2265— SupplyChainProvenanceAnalyzer.BuildIntegrityArms has cognitive complexity 19 (threshold 15). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ExpandWorkspacePattern (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:4198— SupplyChainProvenanceAnalyzer.ExpandWorkspacePattern has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ReadLocalCompositeActions (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5673— SupplyChainProvenanceAnalyzer.ReadLocalCompositeActions has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.WorkflowJobs (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7585— SupplyChainProvenanceAnalyzer.WorkflowJobs has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ReleaseProcedureNamesTarget (cognitive 19) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleasePathReach.cs:227— SupplyChainProvenanceAnalyzer.ReleaseProcedureNamesTarget has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.DetectHubs (cognitive 19) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:1247— ChangeCouplingAnalyzer.DetectHubs has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.IsTransitiveSubtype (cognitive 19) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4398— ChangeCouplingAnalyzer.IsTransitiveSubtype has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FSharpProvider.CollectUntypedBodies (cognitive 19) engine/src/CodeHealth.CodeModel.FSharp/FSharpProvider.fs:86— FSharpProvider.CollectUntypedBodies has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (12 pts), match/switch 6 (7 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FSharpBody.substring (cognitive 19) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:368— FSharpBody.substring has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter.bufferBody (cognitive 19) engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Emitter.java:234— Emitter.bufferBody has cognitive complexity 19 (threshold 15). Drivers by points: loops 12, if/else 2 (4 pts), boolean chains 2, ternaries 1 (nesting depth added 2). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
main.collect_self_fields (cognitive 19) engine/sidecars/python-frontend/main.py:48— main.collect_self_fields 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.
build-quality-pairs-v2.main (cognitive 19) tools/llm-bakeoff/build-quality-pairs-v2.py:120— build-quality-pairs-v2.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (5 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
baseline.run_and_extract (cognitive 19) tools/multilang/baseline.py:204— baseline.run_and_extract has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 3 (6 pts), boolean chains 4, ternaries 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.
layer-attribution-probe.unconditional (cognitive 19) tools/train/backlog-sessions/01a081bf-3479/layer-attribution-probe.py:15— layer-attribution-probe.unconditional has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-calibration.code_window (cognitive 19) tools/train/judge-calibration.py:201— judge-calibration.code_window has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
model-sweep.parse (cognitive 19) tools/train/model-sweep.py:120— model-sweep.parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 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.
report_round.fingerprint_rows (cognitive 19) tools/train/report_round.py:233— report_round.fingerprint_rows has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), loops 3 (4 pts) (nesting depth added 4). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
select_todo.main (cognitive 19) tools/train/select_todo.py:28— select_todo.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, ternaries 2, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bodyResolver.memberAccessShapes (cognitive 19) engine/sidecars/go/bodyshapes.go:398— bodyResolver.memberAccessShapes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 409, 402). 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.
D2 · Cognitive Complexity· main (cognitive 19) · ×1
main (cognitive 19) engine/sidecars/tsjs-frontend/main.mjs:20— main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, error handling 3, loops 2 (3 pts) (nesting depth added 4). Most of this is not in the body itself: 6 of the 19 points are its own statements and the rest belongs to 9 function items inside it that branch (resolveModuleNames::(anonymous), (anonymous), isFile, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SourceClassifier.IsDevelopmentOnlyTree (cognitive 18) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:3573— SourceClassifier.IsDevelopmentOnlyTree has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralFileLengthScanner.RustImplSubject (cognitive 18) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:496— NeutralFileLengthScanner.RustImplSubject has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynDuplicationDetector.IsRenameCopy (cognitive 18) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:274— RoslynDuplicationDetector.IsRenameCopy has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.C1 (cognitive 18) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5054— ComplianceSecurityAnalyzer.C1 has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BundlerManifestHygiene.RuntimeClosure (cognitive 18) engine/src/CodeHealth.Core/Dependencies/BundlerManifestHygiene.cs:301— BundlerManifestHygiene.RuntimeClosure has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmManifestHygiene.FloatingReason (cognitive 18) engine/src/CodeHealth.Core/Dependencies/NpmManifestHygiene.cs:314— NpmManifestHygiene.FloatingReason has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnityLockfileReader.ReadResolved (cognitive 18) engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:58— UnityLockfileReader.ReadResolved has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendToolingManifests.DeclaredWorkspaceDirectories (cognitive 18) engine/src/CodeHealth.Core/Discovery/FrontendToolingManifests.cs:230— FrontendToolingManifests.DeclaredWorkspaceDirectories has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorMarkupReferenceScanner.CollectByComponentAsync (cognitive 18) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:180— RazorMarkupReferenceScanner.CollectByComponentAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.DeclaresPublication (cognitive 18) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:4685— RoslynExplicitDebtCollector.DeclaresPublication has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XamlMarkupReferenceScanner.CollectByComponentAsync (cognitive 18) engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:183— XamlMarkupReferenceScanner.CollectByComponentAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EggMiddlewareNameRefs.Collect (cognitive 18) engine/src/CodeHealth.Core/Frontend/EggMiddlewareNameRefs.cs:51— EggMiddlewareNameRefs.Collect has cognitive complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ForeignLanguageTestRefs.Collect (cognitive 18) engine/src/CodeHealth.Core/Frontend/ForeignLanguageTestRefs.cs:71— ForeignLanguageTestRefs.Collect has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.CollectCrossPackageAssetImports (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1669— FrontendBoundaries.CollectCrossPackageAssetImports has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.EnclosingPublishedPackage (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:2000— FrontendBoundaries.EnclosingPublishedPackage has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendBoundaries.IsNonProductionImporter (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:2103— FrontendBoundaries.IsNonProductionImporter has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeclaredPackageRefs.CollectRouteTrees (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:123— FrontendDeclaredPackageRefs.CollectRouteTrees has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeclaredPackageRefs.CollectConfigReferencedPackages (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:232— FrontendDeclaredPackageRefs.CollectConfigReferencedPackages has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEmittedTemplateRefs.AddEmittedTemplateTreeRefs (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs:31— FrontendEmittedTemplateRefs.AddEmittedTemplateTreeRefs has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendManifestParsing.ReadSubpathImports (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendManifestParsing.cs:325— FrontendManifestParsing.ReadSubpathImports has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendModuleGraph.ReachableFrom (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendModuleGraph.cs:569— FrontendModuleGraph.ReachableFrom has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.IsBehaviourFreeDataModule (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1320— FrontendTestReachability.IsBehaviourFreeDataModule has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendToolAndRuntimeRefs.CollectUnwiredBenchmarkScripts (cognitive 18) engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:675— FrontendToolAndRuntimeRefs.CollectUnwiredBenchmarkScripts has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
JsConstantOnlyField.PropertyWrites (cognitive 18) engine/src/CodeHealth.Core/Frontend/JsConstantOnlyField.cs:188— JsConstantOnlyField.PropertyWrites has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.IsGenericArrowTypeParameterList (cognitive 18) engine/src/CodeHealth.Core/Frontend/JsLexer.Jsx.cs:69— Scanner.IsGenericArrowTypeParameterList has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.ScanJsxExpressionContainer (cognitive 18) engine/src/CodeHealth.Core/Frontend/JsLexer.Jsx.cs:445— Scanner.ScanJsxExpressionContainer has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ModuleGlobPattern.ResolveRepoRelative (cognitive 18) engine/src/CodeHealth.Core/Frontend/ModuleGlobPattern.cs:38— ModuleGlobPattern.ResolveRepoRelative has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleResolver.ConditionAlternatives (cognitive 18) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:936— ModuleResolver.ConditionAlternatives has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.OpensFunctionBody (cognitive 18) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1473— ModuleSyntaxScanner.OpensFunctionBody has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TokenAlignment.LongestMatch (cognitive 18) engine/src/CodeHealth.Core/Frontend/TokenAlignment.cs:99— TokenAlignment.LongestMatch has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupParser.NormalizeBoundAttributes (cognitive 18) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1252— MarkupParser.NormalizeBoundAttributes has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupParser.EnumerateMarkupFiles (cognitive 18) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1455— MarkupParser.EnumerateMarkupFiles has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.VisualAndMotion (cognitive 18) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4496— AccessibilityAnalyzer.VisualAndMotion has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.StyleSheetContrast (cognitive 18) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:4568— AccessibilityAnalyzer.StyleSheetContrast has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.ScriptReachesA11yCheck (cognitive 18) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7026— AccessibilityAnalyzer.ScriptReachesA11yCheck has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.ScalaEventNaming (cognitive 18) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2229— EventDrivenAnalyzer.ScalaEventNaming has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventDrivenAnalyzer.DeclaredConstantsByType (cognitive 18) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2397— EventDrivenAnalyzer.DeclaredConstantsByType has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDomainConventions.RecordsDomainEvents (cognitive 18) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:736— GoDomainConventions.RecordsDomainEvents has cognitive complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
GoDomainConventions.BuildCrossContextProjections (cognitive 18) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:1731— GoDomainConventions.BuildCrossContextProjections has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeadingLabelQualityAnalyzer.AnalyzeAsync (cognitive 18) engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:24— HeadingLabelQualityAnalyzer.AnalyzeAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvocationMatching.WalkTerminatesInMemory (cognitive 18) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:211— InvocationMatching.WalkTerminatesInMemory has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LinkTextQualityAnalyzer.AnalyzeAsync (cognitive 18) engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:24— LinkTextQualityAnalyzer.AnalyzeAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.InspectKeyedSettingFallback (cognitive 18) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:3090— LogicDefectAnalyzer.InspectKeyedSettingFallback has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupTaintPass.CollectSelfContradictions (cognitive 18) engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:458— MarkupTaintPass.CollectSelfContradictions has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BootMechanismDetector.EnumerateRelevantFiles (cognitive 18) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/BootMechanismDetector.cs:40— BootMechanismDetector.EnumerateRelevantFiles has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustDomainConventions.BlockingWaitInHandler (cognitive 18) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:984— RustDomainConventions.BlockingWaitInHandler has cognitive complexity 18 (threshold 15). Of this number, 16 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
SecurityDefectAnalyzer.InspectAddressClassifier (cognitive 18) engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:315— SecurityDefectAnalyzer.InspectAddressClassifier has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SymbolHelpers.IsStronglyTypedId (cognitive 18) engine/src/CodeHealth.Core/ModelAware/SymbolHelpers.cs:727— SymbolHelpers.IsStronglyTypedId has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CiRerunUntilGreenGate.FindLoop (cognitive 18) engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:108— CiRerunUntilGreenGate.FindLoop has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CiRerunUntilGreenGate.Jobs (cognitive 18) engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:301— CiRerunUntilGreenGate.Jobs has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.TestWorkflowsNotGatingPullRequests (cognitive 18) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:365— ProductionReadinessAnalyzer.TestWorkflowsNotGatingPullRequests has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.SastWorkflowsNotGatingMerges (cognitive 18) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:725— ProductionReadinessAnalyzer.SastWorkflowsNotGatingMerges has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureDepth.From (cognitive 18) engine/src/CodeHealth.Core/Scoring/ArchitectureDepth.cs:63— ArchitectureDepth.From has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CodebaseSize.FromDiskAsync (cognitive 18) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:236— CodebaseSize.FromDiskAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeBrowserProvision.ExpectedRevisions (cognitive 18) engine/src/CodeHealth.Core/Testing/NodeBrowserProvision.cs:107— NodeBrowserProvision.ExpectedRevisions has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenameAliases.Build (cognitive 18) engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:53— RenameAliases.Build has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenameAliases.RecreatedRenameSources (cognitive 18) engine/src/CodeHealth.Toolchain/Git/RenameAliases.cs:154— RenameAliases.RecreatedRenameSources has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SdkPinReconciler.TryReconcileFile (cognitive 18) engine/src/CodeHealth.Toolchain/MsBuild/SdkPinReconciler.cs:64— SdkPinReconciler.TryReconcileFile has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeSetBuilder.EmitCommitClusters (cognitive 18) engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:609— ChangeSetBuilder.EmitCommitClusters has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RunLimitations.CoverageRows (cognitive 18) engine/src/CodeHealth.Reporting/Limitations/RunLimitations.cs:449— RunLimitations.CoverageRows has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowedTrendComputer.Compute (cognitive 18) engine/src/CodeHealth.History/Trends/WindowedTrendComputer.cs:13— WindowedTrendComputer.Compute has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitecturalIntegrityAnalyzer.RunAsync (cognitive 18) engine/src/CodeHealth.Dimensions.Architecture/ArchitecturalIntegrityAnalyzer.cs:26— ArchitecturalIntegrityAnalyzer.RunAsync has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: 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.
CloneSpanShape.DataRunTokens (cognitive 18) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3912— CloneSpanShape.DataRunTokens has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyVulnerabilityAnalyzer.CollectPackages (cognitive 18) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityAnalyzer.cs:439— DependencyVulnerabilityAnalyzer.CollectPackages has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConfigCredentialBindingScan.LooksLikeCommittedCredential (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:457— ConfigCredentialBindingScan.LooksLikeCommittedCredential has cognitive complexity 18 (threshold 15). 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.
DeclaredDependencies.RangeAdmits (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/DeclaredDependencies.cs:1438— DeclaredDependencies.RangeAdmits has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyUpdateCooldownCollapse.Collapse (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:36— DependencyUpdateCooldownCollapse.Collapse has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsSiblingScopeReadScan.BareAssignedNames (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:516— JsSiblingScopeReadScan.BareAssignedNames has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupEscapingRecheck.EveryTagAttributeValueLiterallyQuoted (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:357— MarkupEscapingRecheck.EveryTagAttributeValueLiterallyQuoted has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
MutableGitCloneScan.FindingsInStage (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:103— MutableGitCloneScan.FindingsInStage has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrimaryConstructorShadow.SkipTypeName (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/PrimaryConstructorShadow.cs:283— PrimaryConstructorShadow.SkipTypeName has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PullRequestTargetCheckoutRecheck.CheckoutStepBlock (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/PullRequestTargetCheckoutRecheck.cs:125— PullRequestTargetCheckoutRecheck.CheckoutStepBlock has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.IsEnumeratedDocExampleBinding (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2647— SecretNoiseFilter.IsEnumeratedDocExampleBinding has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.IsPublicHyperlinkUrlParameter (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3167— SecretNoiseFilter.IsPublicHyperlinkUrlParameter has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SemgrepClaimRecheck.CallHasNoShell (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepClaimRecheck.cs:174— SemgrepClaimRecheck.CallHasNoShell has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileModel.IsDelimiterDoublingQuoter (cognitive 18) engine/src/CodeHealth.Dimensions.Security/Scanners/SqlBuilderCompositionWalk.cs:1226— FileModel.IsDelimiterDoublingQuoter has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretsHistoryAnalyzer.StripNotGroups (cognitive 18) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1742— SecretsHistoryAnalyzer.StripNotGroups has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.AnyDeep (cognitive 18) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:4564— SupplyChainProvenanceAnalyzer.AnyDeep has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.ScanBuildManifests (cognitive 18) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5920— SupplyChainProvenanceAnalyzer.ScanBuildManifests has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.IsVersionStampFile (cognitive 18) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:2679— ChangeCouplingAnalyzer.IsVersionStampFile has cognitive complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.CallsRustSplitInherentImplMethods (cognitive 18) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3031— ChangeCouplingAnalyzer.CallsRustSplitInherentImplMethods has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.RepoDeclaredBaseClasses (cognitive 18) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3884— ChangeCouplingAnalyzer.RepoDeclaredBaseClasses has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestReliabilityAnalyzer.NodeOnlyAsync (cognitive 18) engine/src/CodeHealth.Dimensions.Testing/TestReliabilityAnalyzer.cs:600— TestReliabilityAnalyzer.NodeOnlyAsync has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TestReliabilityAnalyzer.PolyglotUnmeasured (cognitive 18) engine/src/CodeHealth.Dimensions.Testing/TestReliabilityAnalyzer.cs:868— TestReliabilityAnalyzer.PolyglotUnmeasured has cognitive complexity 18 (threshold 15). 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.
FSharpBody.gather (cognitive 18) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:66— FSharpBody.gather has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
check.main (cognitive 18) engine/sidecars/java-spoon/selftest/check.py:32— check.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BranchWalker._scan_expr (cognitive 18) engine/sidecars/python-frontend/bodyfacts.py:133— BranchWalker._scan_expr has cognitive complexity 18 (threshold 15). Drivers by points: loops 6 (12 pts), if/else 4, ternaries 1 (2 pts) (nesting depth added 7). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Resolver.call_target (cognitive 18) engine/sidecars/python-frontend/common.py:514— Resolver.call_target has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 2 (5 pts), boolean chains 3, 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.
draw.naming_subject (cognitive 18) tools/rescan/draw.py:99— draw.naming_subject has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
evidence-ab.tally (cognitive 18) tools/train/evidence-ab.py:165— evidence-ab.tally has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fallback-judge.shape_check (cognitive 18) tools/train/fallback-judge.py:293— fallback-judge.shape_check has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 6, loops 3, ternaries 1. 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.
programme-status.snapshot_arms (cognitive 18) tools/train/programme-status.py:199— programme-status.snapshot_arms has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (6 pts), error handling 1 (5 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.
report_round.self_check (cognitive 18) tools/train/report_round.py:376— report_round.self_check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
report_verification.main (cognitive 18) tools/train/report_verification.py:163— report_verification.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9, boolean chains 3, error handling 2, loops 2, ternaries 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
main.main (cognitive 18) engine/sidecars/php-frontend/main.php:551— main.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 5 (7 pts), boolean chains 1, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
main.parseGoMod (cognitive 18) engine/sidecars/go/discover.go:89— main.parseGoMod has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
observe-proxy.main (cognitive 18) engine/docker/analyzer/render/observe-proxy.mjs:45— observe-proxy.main has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, error handling 2 (3 pts), loops 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 53, 61, 56, …). 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.
ts-helpers.stripStringsAndComments (cognitive 18) engine/sidecars/tsjs-frontend/ts-helpers.mjs:106— ts-helpers.stripStringsAndComments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 4, loops 2 (4 pts), ternaries 1 (2 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.
BicepExtractor.Extract (cognitive 17) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/BicepExtractor.cs:25— BicepExtractor.Extract has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PulumiExtractor.Classify (cognitive 17) engine/src/CodeHealth.Core/Architecture/Topology/Extractors/PulumiExtractor.cs:67— PulumiExtractor.Classify has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
SourceClassifier.IsTestDirectorySegment (cognitive 17) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:291— SourceClassifier.IsTestDirectorySegment has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSharpDeclarationRunTokenizer.Append (cognitive 17) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpDeclarationRunTokenizer.cs:48— CSharpDeclarationRunTokenizer.Append has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineBasedGodClassDetector.GoStructGrainScan (cognitive 17) engine/src/CodeHealth.Core/CodeShape/LineBasedGodClassDetector.cs:325— LineBasedGodClassDetector.GoStructGrainScan has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
NeutralFileLengthScanner.SkipErlangCharLiteral (cognitive 17) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:1195— NeutralFileLengthScanner.SkipErlangCharLiteral has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PublishedSurfaceProbe.Discover (cognitive 17) engine/src/CodeHealth.Core/CodeShape/PublishedSurfaceProbe.cs:92— PublishedSurfaceProbe.Discover has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RazorCodeVirtualizer.FindNextBlock (cognitive 17) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:193— RazorCodeVirtualizer.FindNextBlock has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynDuplicationDetector.AppendSoleLabelClones (cognitive 17) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:4218— RoslynDuplicationDetector.AppendSoleLabelClones has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineLexer.CharLiteralEnd (cognitive 17) engine/src/CodeHealth.Core/CodeShape/RustInlineTestRegions.cs:444— LineLexer.CharLiteralEnd has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanWrongDirectionTransform (cognitive 17) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2533— ComplianceSecurityAnalyzer.ScanWrongDirectionTransform has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectCustomAuthorizeAttributes (cognitive 17) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4288— ComplianceSecurityAnalyzer.DetectCustomAuthorizeAttributes has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.DetectSelfHostedRpcSurface (cognitive 17) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4585— ComplianceSecurityAnalyzer.DetectSelfHostedRpcSurface has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MavenResolvedGraph.Parse (cognitive 17) engine/src/CodeHealth.Core/Dependencies/MavenResolvedGraph.cs:48— MavenResolvedGraph.Parse has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmCurrencyCollector.CollectAsync (cognitive 17) engine/src/CodeHealth.Core/Dependencies/NpmCurrencyCollector.cs:63— NpmCurrencyCollector.CollectAsync has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
UnityLockfileReader.ReadRegistryDirect (cognitive 17) engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:128— UnityLockfileReader.ReadRegistryDirect has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AdrDetector.IsExcludedNonAdr (cognitive 17) engine/src/CodeHealth.Core/Docs/AdrDetector.cs:406— AdrDetector.IsExcludedNonAdr has cognitive complexity 17 (threshold 15). 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.
ConditionalSymbolInventory.AddTemplateManifestSymbols (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/ConditionalSymbolInventory.cs:199— ConditionalSymbolInventory.AddTemplateManifestSymbols has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RazorMarkupReferenceScanner.CollectQualifiedMemberNamesAsync (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/RazorMarkupReferenceScanner.cs:118— RazorMarkupReferenceScanner.CollectQualifiedMemberNamesAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectContradictedWarningsAsErrors (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:5244— RoslynExplicitDebtCollector.CollectContradictedWarningsAsErrors has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectEditorConfigSeverityNone (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:6414— RoslynExplicitDebtCollector.CollectEditorConfigSeverityNone has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynExplicitDebtCollector.CollectVbObsoleteAsync (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.Vb.cs:430— RoslynExplicitDebtCollector.CollectVbObsoleteAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XamlMarkupReferenceScanner.CollectTypeNamesAsync (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/XamlMarkupReferenceScanner.cs:115— XamlMarkupReferenceScanner.CollectTypeNamesAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YamlDisabledConfigScanner.IsAlsoSetLive (cognitive 17) engine/src/CodeHealth.Core/ExplicitDebt/YamlDisabledConfigScanner.cs:429— YamlDisabledConfigScanner.IsAlsoSetLive has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryForkDetector.Descend (cognitive 17) engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:254— DirectoryForkDetector.Descend has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EntryPointCatalog.AddPathLiteralInvocations (cognitive 17) engine/src/CodeHealth.Core/Frontend/EntryPointCatalog.cs:2757— EntryPointCatalog.AddPathLiteralInvocations has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDeclaredPackageRefs.CollectSourceEmittedSpecifierPackages (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:562— FrontendDeclaredPackageRefs.CollectSourceEmittedSpecifierPackages has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.InsideAliasMap (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:587— FrontendDependencyHygiene.InsideAliasMap has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendDependencyHygiene.IsInvokedInScripts (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendDependencyHygiene.cs:1472— FrontendDependencyHygiene.IsInvokedInScripts has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
FrontendEngineDimensions.DetectRemovalGate (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:566— FrontendEngineDimensions.DetectRemovalGate has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendEngineDimensions.HygieneDimension (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendEngineDimensions.cs:861— FrontendEngineDimensions.HygieneDimension has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendPathLiteralRefs.CollectGoEmbedRefs (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:498— FrontendPathLiteralRefs.CollectGoEmbedRefs has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendPathLiteralRefs.AddComputedDirPathRefs (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendPathLiteralRefs.cs:859— FrontendPathLiteralRefs.AddComputedDirPathRefs has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendScriptCommandRefs.ShellLauncherScripts (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:317— FrontendScriptCommandRefs.ShellLauncherScripts has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendWorkspaceLoader.EnumerateSourceMaps (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceLoader.BuildOutput.cs:100— FrontendWorkspaceLoader.EnumerateSourceMaps has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendWorkspaceWalk.CollectVendoredNodeModuleDirectories (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:120— FrontendWorkspaceWalk.CollectVendoredNodeModuleDirectories has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
FrontendWorkspaceWalk.IsNpmBinEntryDirectory (cognitive 17) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:895— FrontendWorkspaceWalk.IsNpmBinEntryDirectory has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JsCloneNearExactness.Agreement (cognitive 17) engine/src/CodeHealth.Core/Frontend/JsCloneNearExactness.cs:426— JsCloneNearExactness.Agreement has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsComplexity.BuildMask (cognitive 17) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:157— JsComplexity.BuildMask has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.IsTypeMemberList (cognitive 17) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:7640— JsDuplicationDetector.IsTypeMemberList has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsStringConstants.BindParameters (cognitive 17) engine/src/CodeHealth.Core/Frontend/JsStringConstants.cs:126— JsStringConstants.BindParameters has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ModuleResolver.TryResolveImportsMap (cognitive 17) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:863— ModuleResolver.TryResolveImportsMap has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.TryCommonJsExport (cognitive 17) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1094— ModuleSyntaxScanner.TryCommonJsExport has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsConfigStrictness.Read (cognitive 17) engine/src/CodeHealth.Core/Frontend/TsConfigStrictness.cs:54— TsConfigStrictness.Read has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.JvmStandardLayoutSeparation (cognitive 17) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:2642— MaturityAnalyzer.JvmStandardLayoutSeparation has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.LoadedScriptText (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:556— AccessibilityAnalyzer.LoadedScriptText has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.ScanIconLibraryImports (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:2041— AccessibilityAnalyzer.ScanIconLibraryImports has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CollectScriptRevealedIds (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5598— AccessibilityAnalyzer.CollectScriptRevealedIds has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.EnumerateStyleFiles (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5969— AccessibilityAnalyzer.EnumerateStyleFiles has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
AccessibilityAnalyzer.CountUnreadHtmlStringMarkup (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.HtmlStringBlindness.cs:109— AccessibilityAnalyzer.CountUnreadHtmlStringMarkup has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllowlistGate.Prove (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:73— AllowlistGate.Prove has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllowlistGate.Evaluate (cognitive 17) engine/src/CodeHealth.Core/ModelAware/AllowlistGate.cs:217— AllowlistGate.Evaluate has cognitive complexity 17 (threshold 15). 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.
CSharpCorrectnessAnalyzer.IsAssertedCompleteBeforehand (cognitive 17) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:2478— CSharpCorrectnessAnalyzer.IsAssertedCompleteBeforehand has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CsprojReferenceGraph.BuildDisplayNames (cognitive 17) engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:777— CsprojReferenceGraph.BuildDisplayNames has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErlangDomainConventions.BlockingHandlers (cognitive 17) engine/src/CodeHealth.Core/ModelAware/ErlangDomainConventions.cs:346— ErlangDomainConventions.BlockingHandlers has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoDomainConventions.FoldMethods (cognitive 17) engine/src/CodeHealth.Core/ModelAware/GoDomainConventions.cs:846— GoDomainConventions.FoldMethods has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.OverriddenMethodNamesAsync (cognitive 17) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:1219— IncompletenessAnalyzer.OverriddenMethodNamesAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IncompletenessAnalyzer.MessageSaysNotDone (cognitive 17) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3076— IncompletenessAnalyzer.MessageSaysNotDone has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.InspectDroppedDisposalDuty (cognitive 17) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:1644— LogicDefectAnalyzer.InspectDroppedDisposalDuty has cognitive complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 7 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LogicDefectAnalyzer.InspectUnsynchronisedHandoff (cognitive 17) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:3472— LogicDefectAnalyzer.InspectUnsynchronisedHandoff has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecurityDefectAnalyzer.InspectUncappedDocumentWalk (cognitive 17) engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:542— SecurityDefectAnalyzer.InspectUncappedDocumentWalk has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecurityDefectAnalyzer.CountsItsDescent (cognitive 17) engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:711— SecurityDefectAnalyzer.CountsItsDescent has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwiftDomainConventions.SwiftDualWrites (cognitive 17) engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:740— SwiftDomainConventions.SwiftDualWrites has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.HasSourceBackupControl (cognitive 17) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:1490— ProductionReadinessAnalyzer.HasSourceBackupControl has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.ContainerStackText (cognitive 17) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2442— ProductionReadinessAnalyzer.ContainerStackText has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.FirstPartyChartManifests (cognitive 17) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3119— ProductionReadinessAnalyzer.FirstPartyChartManifests has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeSecretScanner.ScanAsync (cognitive 17) engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:431— NativeSecretScanner.ScanAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SyftSbomNormalizer.ReadLicenses (cognitive 17) engine/src/CodeHealth.Core/Security/SyftSbomNormalizer.cs:128— SyftSbomNormalizer.ReadLicenses has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyGraph.FindCycles (cognitive 17) engine/src/CodeHealth.Core/Statistics/DependencyGraph.cs:26— DependencyGraph.FindCycles has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotnetBuildStatistician.UninitialisedSubmodules (cognitive 17) engine/src/CodeHealth.Core/Statistics/DotnetBuildStatistician.cs:519— DotnetBuildStatistician.UninitialisedSubmodules has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommittedCoverageReader.EnumerateCandidates (cognitive 17) engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:211— CommittedCoverageReader.EnumerateCandidates has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CoverletCoverageCollector.CollectUncachedAsync (cognitive 17) engine/src/CodeHealth.Core/Testing/CoverletCoverageCollector.cs:82— CoverletCoverageCollector.CollectUncachedAsync has cognitive complexity 17 (threshold 15). 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.
DiskTestScanner.EnumerateTestSyntax (cognitive 17) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:24— DiskTestScanner.EnumerateTestSyntax has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskTestScanner.HasFormulaInlineTestSuite (cognitive 17) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:673— DiskTestScanner.HasFormulaInlineTestSuite has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GoTestCensus.GoTestFiles (cognitive 17) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:511— GoTestCensus.GoTestFiles has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
NodeTestSuiteCoverageCollector.CollectUncachedAsync (cognitive 17) engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:92— NodeTestSuiteCoverageCollector.CollectUncachedAsync has cognitive complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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.
NodeTestSuiteCoverageCollector.GatherLcov (cognitive 17) engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:870— NodeTestSuiteCoverageCollector.GatherLcov has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeTestSuiteProbe.FindLockfile (cognitive 17) engine/src/CodeHealth.Core/Testing/NodeTestSuiteProbe.cs:527— NodeTestSuiteProbe.FindLockfile has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NodeWorkspaceSiblingBuilder.EntryPoint (cognitive 17) engine/src/CodeHealth.Core/Testing/NodeWorkspaceSiblingBuilder.cs:147— NodeWorkspaceSiblingBuilder.EntryPoint has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynTestQualityCollector.PublicHost (cognitive 17) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:861— RoslynTestQualityCollector.PublicHost has cognitive complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RustTestCensus.RustFiles (cognitive 17) engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:426— RustTestCensus.RustFiles has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TestProjectDetection.UnconditionalIsTestProject (cognitive 17) engine/src/CodeHealth.Core/Testing/TestProjectDetection.cs:513— TestProjectDetection.UnconditionalIsTestProject has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
XPlatCollectorProbe.IsWiredUp (cognitive 17) engine/src/CodeHealth.Core/Testing/XPlatCollectorProbe.cs:72— XPlatCollectorProbe.IsWiredUp has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResxFileRefNormalizer.NormalizeFile (cognitive 17) engine/src/CodeHealth.Toolchain/MsBuild/ResxFileRefNormalizer.cs:49— ResxFileRefNormalizer.NormalizeFile has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MsBuildRoslynWorkspace.BreakProjectReferenceCycles (cognitive 17) engine/src/CodeHealth.Toolchain/Roslyn/MsBuildRoslynWorkspace.cs:552— MsBuildRoslynWorkspace.BreakProjectReferenceCycles has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileProgressSink.WriteSnapshot (cognitive 17) engine/src/CodeHealth.Cli/Ui/FileProgressSink.cs:81— FileProgressSink.WriteSnapshot has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangelogDraftRenderer.RenderSystemOverview (cognitive 17) engine/src/CodeHealth.Reporting/Changelog/ChangelogDraftRenderer.cs:102— ChangelogDraftRenderer.RenderSystemOverview has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangelogNarrator.DescribeEntryAsync (cognitive 17) engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:726— ChangelogNarrator.DescribeEntryAsync has cognitive complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReportViewModelFactory.BuildTrajectory (cognitive 17) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:2130— ReportViewModelFactory.BuildTrajectory has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NavigabilityAnalyzer.RunAsync (cognitive 17) engine/src/CodeHealth.Dimensions.Architecture/NavigabilityAnalyzer.cs:38— NavigabilityAnalyzer.RunAsync has cognitive complexity 17 (threshold 15). 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.
CloneSpanShape.OpenBlocksInsideEnclosingDeclaration (cognitive 17) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:4445— CloneSpanShape.OpenBlocksInsideEnclosingDeclaration has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplexityDisclosure.NestedItemDisclosure (cognitive 17) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/ComplexityDisclosure.cs:46— ComplexityDisclosure.NestedItemDisclosure has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplexityScoring.DropRepublishedSidecarUnits (cognitive 17) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/ComplexityScoring.cs:743— ComplexityScoring.DropRepublishedSidecarUnits has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OsvDependencyVulnerabilityArm.CollectAsync (cognitive 17) engine/src/CodeHealth.Dimensions.Security/OsvScannerAnalyzer.cs:41— OsvDependencyVulnerabilityArm.CollectAsync has cognitive complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ComposeServiceSurface.BuiltAsAnyOf (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:241— ComposeServiceSurface.BuiltAsAnyOf has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DockerfileSyntax.AppendHeredocScript (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:225— DockerfileSyntax.AppendHeredocScript has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EolActionMajorRepositoryFold.Fold (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/EolActionMajorRepositoryFold.cs:116— EolActionMajorRepositoryFold.Fold has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InactivePreprocessorRegion.EnclosingCondition (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/InactivePreprocessorRegion.cs:81— InactivePreprocessorRegion.EnclosingCondition has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsSiblingScopeReadScan.BindsOnLine (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/JsSiblingScopeReadScan.cs:476— JsSiblingScopeReadScan.BindsOnLine has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsValueFlow.ArgumentNamesAllResolved (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/JsValueFlow.cs:68— JsValueFlow.ArgumentNamesAllResolved has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MarkupEscapingRecheck.GoHtmlTemplateAutoEscaped (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/MarkupEscapingRecheck.cs:606— MarkupEscapingRecheck.GoHtmlTemplateAutoEscaped has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutableGitCloneScan.StageRef (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:290— MutableGitCloneScan.StageRef has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NginxDirectiveRecheck.NginxConfNeighbourhood (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/NginxDirectiveRecheck.cs:273— NginxDirectiveRecheck.NginxConfNeighbourhood has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
NoOpToolShimScan.FindingsInStage (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:120— NoOpToolShimScan.FindingsInStage has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SemverRange.Admits (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/NpmLockGraph.cs:484— SemverRange.Admits has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PathContainmentRecheck.CombineAppendsOnlyLiterals (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/PathContainmentRecheck.cs:213— PathContainmentRecheck.CombineAppendsOnlyLiterals has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RubyArgumentMutatedScan.MutatesHere (cognitive 17) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:576— RubyArgumentMutatedScan.MutatesHere has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ScanGoReleaserManifest (cognitive 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5124— SupplyChainProvenanceAnalyzer.ScanGoReleaserManifest has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.JobNeeds (cognitive 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8581— SupplyChainProvenanceAnalyzer.JobNeeds has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UnapprovedBranchPushTriggeredPublishes (cognitive 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8637— SupplyChainProvenanceAnalyzer.UnapprovedBranchPushTriggeredPublishes has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.SupplementaryCiPublishes (cognitive 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PublishTrigger.cs:306— SupplyChainProvenanceAnalyzer.SupplementaryCiPublishes has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UnlockedReleaseInstalls (cognitive 17) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleaseInstallLock.cs:95— SupplyChainProvenanceAnalyzer.UnlockedReleaseInstalls has cognitive complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 belong to 2 function literals inside it that branch. 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.
ChangeCouplingAnalyzer.IsSharedPlatformContractSiblings (cognitive 17) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3790— ChangeCouplingAnalyzer.IsSharedPlatformContractSiblings has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.RepoDeclaredContracts (cognitive 17) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3837— ChangeCouplingAnalyzer.RepoDeclaredContracts has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FSharpBody.walk (cognitive 17) engine/src/CodeHealth.CodeModel.FSharp/Body.fs:116— FSharpBody.walk has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (8 pts), match/switch 3 (6 pts), if/else 2 (3 pts) (nesting depth added 8). 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.
ModelBuilder.BuildMembers (cognitive 17) engine/src/CodeHealth.CodeModel.FSharp/Builder.fs:427— ModelBuilder.BuildMembers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter.emitType (cognitive 17) engine/sidecars/kotlin-frontend/src/main/kotlin/dev/canine/codehealth/kotlin/Emitter.kt:93— Emitter.emitType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, 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.
Main.main (cognitive 17) engine/sidecars/scala-frontend/src/main/scala/dev/canine/codehealth/scala/Main.scala:24— Main.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (2 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
build-quality-pairs-v2.comment_lines (cognitive 17) tools/llm-bakeoff/build-quality-pairs-v2.py:39— build-quality-pairs-v2.comment_lines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-quality-pairs.comment_lines (cognitive 17) tools/llm-bakeoff/build-quality-pairs.py:40— build-quality-pairs.comment_lines has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), ternaries 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parallel-sweep.main (cognitive 17) tools/llm-bakeoff/parallel-sweep.py:37— parallel-sweep.main has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (6 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
runner.main (cognitive 17) tools/rescan/runner.py:257— runner.main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6, loops 3 (5 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
fallback-judge.render_md (cognitive 17) tools/train/fallback-judge.py:457— fallback-judge.render_md has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), loops 4 (5 pts), if/else 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.
judge-calibration.enclosing_block (cognitive 17) tools/train/judge-calibration.py:142— judge-calibration.enclosing_block has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BodyFacts.rethrows (cognitive 17) engine/sidecars/php-frontend/body.php:614— BodyFacts.rethrows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), boolean chains 4, loops 2 (4 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.
main.invocationGroups (cognitive 17) engine/sidecars/go/bodylines.go:150— main.invocationGroups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 2). Most of this is not in the body itself: 7 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 191, 175). 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.
main.parsedFiles (cognitive 17) engine/sidecars/go/scan.go:208— main.parsedFiles has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 2 (8 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
extractor.assertedTypeFqn (cognitive 17) engine/sidecars/go/implements.go:150— extractor.assertedTypeFqn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emit.members (cognitive 17) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Emit.swift:181— Emit.members has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), boolean chains 2, 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· main (cognitive 17) · ×1
main (cognitive 17) tools/localdev/ui/capture.mjs:105— main has cognitive complexity 17 (threshold 15). Drivers by points: loops 4 (5 pts), ternaries 4 (5 pts), if/else 3 (4 pts), other 2, boolean chains 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 11 function items inside it that branch (card, (anonymous), (anonymous), …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
typeEmitters::heritageOf (cognitive 17) engine/sidecars/tsjs-frontend/extract-file.mjs:367— typeEmitters::heritageOf has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 1 (4 pts), loops 2 (3 pts), boolean chains 2, other 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiSurfaceExtractor.CollectGroupPrefixes (cognitive 16) engine/src/CodeHealth.Core/ApiSurface/ApiSurfaceExtractor.cs:176— ApiSurfaceExtractor.CollectGroupPrefixes has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ApiSurfaceExtractor.ScanAttributeControllers (cognitive 16) engine/src/CodeHealth.Core/ApiSurface/ApiSurfaceExtractor.cs:305— ApiSurfaceExtractor.ScanAttributeControllers has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.WithoutNonDominantRegionInteriors (cognitive 16) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:795— SourceClassifier.WithoutNonDominantRegionInteriors has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.IsWellKnownVendorFile (cognitive 16) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:2267— SourceClassifier.IsWellKnownVendorFile has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.HasDemonstrationSegment (cognitive 16) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:2528— SourceClassifier.HasDemonstrationSegment has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SourceClassifier.IsDevelopmentOnlyDotnetProject (cognitive 16) engine/src/CodeHealth.Core/Classification/SourceClassifier.cs:2958— SourceClassifier.IsDevelopmentOnlyDotnetProject has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CSharpCloneTokenizer.IsInExecutableBody (cognitive 16) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:144— CSharpCloneTokenizer.IsInExecutableBody has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NeutralFileLengthScanner.DominantDeclaration (cognitive 16) engine/src/CodeHealth.Core/CodeShape/NeutralFileLengthScanner.cs:188— NeutralFileLengthScanner.DominantDeclaration has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RazorCodeVirtualizer.EnumerateRazorFiles (cognitive 16) engine/src/CodeHealth.Core/CodeShape/RazorCodeVirtualizer.cs:107— RazorCodeVirtualizer.EnumerateRazorFiles has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RoslynDuplicationDetector.Coalesce (cognitive 16) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:3841— RoslynDuplicationDetector.Coalesce has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FirstPartyJsComplexity.AddFileUnits (cognitive 16) engine/src/CodeHealth.Core/Complexity/FirstPartyJsComplexity.cs:87— FirstPartyJsComplexity.AddFileUnits has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComplianceSecurityAnalyzer.ScanRazorAuthorizationAsync (cognitive 16) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:6445— ComplianceSecurityAnalyzer.ScanRazorAuthorizationAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GemVersion.Compare (cognitive 16) engine/src/CodeHealth.Core/Dependencies/GemVersion.cs:115— GemVersion.Compare has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmLockfileReader.ReadPackageLock (cognitive 16) engine/src/CodeHealth.Core/Dependencies/NpmLockfileReader.cs:35— NpmLockfileReader.ReadPackageLock has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NpmManifestHygiene.ResolvedDirectProduction (cognitive 16) engine/src/CodeHealth.Core/Dependencies/NpmManifestHygiene.cs:414— NpmManifestHygiene.ResolvedDirectProduction has cognitive complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
MarkdownSnippetReferenceScanner.SafeEnumerateMarkdown (cognitive 16) engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs:210— MarkdownSnippetReferenceScanner.SafeEnumerateMarkdown has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynExplicitDebtCollector.CollectComments (cognitive 16) engine/src/CodeHealth.Core/ExplicitDebt/RoslynExplicitDebtCollector.cs:1668— RoslynExplicitDebtCollector.CollectComments has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SourceCommentTaskScanner.CommentStart (cognitive 16) engine/src/CodeHealth.Core/ExplicitDebt/SourceCommentTaskScanner.cs:126— SourceCommentTaskScanner.CommentStart has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
YamlDisabledConfigScanner.ScanLines (cognitive 16) engine/src/CodeHealth.Core/ExplicitDebt/YamlDisabledConfigScanner.cs:219— YamlDisabledConfigScanner.ScanLines has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DashboardExportHeuristics.DeclaresDashboardSchema (cognitive 16) engine/src/CodeHealth.Core/FileQuality/DashboardExportHeuristics.cs:67— DashboardExportHeuristics.DeclaresDashboardSchema has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneratedCodePolicy.ForRepo (cognitive 16) engine/src/CodeHealth.Core/FileQuality/GeneratedCodePolicy.cs:43— GeneratedCodePolicy.ForRepo has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryForkDetector.HashTextFile (cognitive 16) engine/src/CodeHealth.Core/Frontend/DirectoryForkDetector.cs:487— DirectoryForkDetector.HashTextFile has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ForeignPackageOwnership.IsForeignOwnedDirectory (cognitive 16) engine/src/CodeHealth.Core/Frontend/ForeignPackageOwnership.cs:108— ForeignPackageOwnership.IsForeignOwnedDirectory has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendConfigResolution.ParsePnpmPackages (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:58— FrontendConfigResolution.ParsePnpmPackages has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.TemplateLiteralLiteralTail (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:223— FrontendSpecifierScanning.TemplateLiteralLiteralTail has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendSpecifierScanning.CollectBundlerExternalSpecifiers (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:345— FrontendSpecifierScanning.CollectBundlerExternalSpecifiers has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.EverySuiteRunsInABrowser (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:755— FrontendTestReachability.EverySuiteRunsInABrowser has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FrontendTestReachability.IsDeclarationOnly (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1858— FrontendTestReachability.IsDeclarationOnly has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsConfigGlob.ToRegex (cognitive 16) engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceFacts.cs:303— TsConfigGlob.ToRegex has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsComplexity.ComputeCyclomatic (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsComplexity.cs:199— JsComplexity.ComputeCyclomatic has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.BestPeriodAnchor (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4808— JsDuplicationDetector.BestPeriodAnchor has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsDuplicationDetector.IsLiteralJsxTagPunctuation (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:8238— JsDuplicationDetector.IsLiteralJsxTagPunctuation has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner.ScanOnce (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:119— Scanner.ScanOnce has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Scanner.DecodeUnicodeEscape (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsLexer.cs:543— Scanner.DecodeUnicodeEscape has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsScopeBindings.ArrowParameterRange (cognitive 16) engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:604— JsScopeBindings.ArrowParameterRange has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleSyntaxScanner.AddRuntimeGlobLoaderImports (cognitive 16) engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs:1710— ModuleSyntaxScanner.AddRuntimeGlobLoaderImports has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ArchGraphClustering.Build (cognitive 16) engine/src/CodeHealth.Core/Graph/ArchGraphClustering.cs:30— ArchGraphClustering.Build has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AstroMarkupProducer.NextRawTextOpen (cognitive 16) engine/src/CodeHealth.Core/Markup/AstroMarkupProducer.cs:297— AstroMarkupProducer.NextRawTextOpen has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MaturityAnalyzer.IsArchitectureCodeTour (cognitive 16) engine/src/CodeHealth.Core/Maturity/MaturityAnalyzer.cs:3886— MaturityAnalyzer.IsArchitectureCodeTour has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AccessibilityAnalyzer.CollectPackageScriptFacts (cognitive 16) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6885— AccessibilityAnalyzer.CollectPackageScriptFacts has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AltTextQualityAnalyzer.AnalyzeAsync (cognitive 16) engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:25— AltTextQualityAnalyzer.AnalyzeAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ArchitectureModelAnalyzer.CaptiveDependencies (cognitive 16) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:1815— ArchitectureModelAnalyzer.CaptiveDependencies has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CryptoShreddingDetector.IsDiscarded (cognitive 16) engine/src/CodeHealth.Core/ModelAware/CryptoShreddingDetector.cs:755— CryptoShreddingDetector.IsDiscarded has cognitive complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
DomainModelAnalyzer.RepositoryContractSubjects (cognitive 16) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1760— DomainModelAnalyzer.RepositoryContractSubjects has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
DomainModelAnalyzer.FirstCrossAggregateStitch (cognitive 16) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2095— DomainModelAnalyzer.FirstCrossAggregateStitch has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvocationMatching.WalkTerminatesInMemory (cognitive 16) engine/src/CodeHealth.Core/ModelAware/InvocationMatching.cs:283— InvocationMatching.WalkTerminatesInMemory has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.InspectInertConfigurationKnob (cognitive 16) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:2869— LogicDefectAnalyzer.InspectInertConfigurationKnob has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicDefectAnalyzer.EmptinessClaim (cognitive 16) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:4437— LogicDefectAnalyzer.EmptinessClaim has cognitive complexity 16 (threshold 15). 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.
MutationIdempotencyAnalyzer.BuildCard (cognitive 16) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:913— MutationIdempotencyAnalyzer.BuildCard has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MutationIdempotencyAnalyzer.IsFixedValueSetViaDomainMethod (cognitive 16) engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1655— MutationIdempotencyAnalyzer.IsFixedValueSetViaDomainMethod has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OperabilityExtrasAnalyzer.LibraryPublicApiAsync (cognitive 16) engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:235— OperabilityExtrasAnalyzer.LibraryPublicApiAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackageIndex.Build (cognitive 16) engine/src/CodeHealth.Core/ModelAware/PackageIndex.cs:16— PackageIndex.Build has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
BootedAppRenderer.DiscoverByPortProbeAsync (cognitive 16) engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:292— BootedAppRenderer.DiscoverByPortProbeAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScalaDomainConventions.BypassableInvariantEntities (cognitive 16) engine/src/CodeHealth.Core/ModelAware/ScalaDomainConventions.cs:948— ScalaDomainConventions.BypassableInvariantEntities has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SymbolHelpers.HasIdWrapperBase (cognitive 16) engine/src/CodeHealth.Core/ModelAware/SymbolHelpers.cs:682— SymbolHelpers.HasIdWrapperBase has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TemplateDetection.IsTemplateProject (cognitive 16) engine/src/CodeHealth.Core/ModelAware/TemplateDetection.cs:67— TemplateDetection.IsTemplateProject has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CiRerunUntilGreenGate.Steps (cognitive 16) engine/src/CodeHealth.Core/Readiness/CiRerunUntilGreenGate.cs:253— CiRerunUntilGreenGate.Steps has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CiWorkflowReader.AppendMakeRecipes (cognitive 16) engine/src/CodeHealth.Core/Readiness/CiWorkflowReader.cs:474— CiWorkflowReader.AppendMakeRecipes has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.HasAppleNativePersistence (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:1824— ProductionReadinessAnalyzer.HasAppleNativePersistence has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.HasKubernetesPersistentVolumeClaim (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:2505— ProductionReadinessAnalyzer.HasKubernetesPersistentVolumeClaim has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.HasOtpApplicationVersion (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3002— ProductionReadinessAnalyzer.HasOtpApplicationVersion has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.InvokedScriptText (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:3645— ProductionReadinessAnalyzer.InvokedScriptText has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.ScanForAuditSuppression (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5020— ProductionReadinessAnalyzer.ScanForAuditSuppression has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.ComposePublishedPortEntries (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6661— ProductionReadinessAnalyzer.ComposePublishedPortEntries has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductionReadinessAnalyzer.HasInSourceHealthProbeEndpoints (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:6780— ProductionReadinessAnalyzer.HasInSourceHealthProbeEndpoints has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ProductionReadinessAnalyzer.IncludedMakefiles (cognitive 16) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7529— ProductionReadinessAnalyzer.IncludedMakefiles has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskSourceFiles.ProductionLocByFileAsync (cognitive 16) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:237— DiskSourceFiles.ProductionLocByFileAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskSourceFiles.SkipTrivia (cognitive 16) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:373— DiskSourceFiles.SkipTrivia has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotnetProjectFiles.ExistUnder (cognitive 16) engine/src/CodeHealth.Core/Scoring/DotnetProjectFiles.cs:36— DotnetProjectFiles.ExistUnder has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
LayerConventions.FindViolations (cognitive 16) engine/src/CodeHealth.Core/Statistics/LayerConventions.cs:87— LayerConventions.FindViolations has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DotnetTestReliabilityCollector.MergeTrx (cognitive 16) engine/src/CodeHealth.Core/Testing/DotnetTestReliabilityCollector.cs:267— DotnetTestReliabilityCollector.MergeTrx has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsTestQualityCensus.ParameterBefore (cognitive 16) engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:495— JsTestQualityCensus.ParameterBefore has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RoslynTestQualityCollector.ReachableBodies (cognitive 16) engine/src/CodeHealth.Core/Testing/RoslynTestQualityCollector.cs:1321— RoslynTestQualityCollector.ReachableBodies has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LlmProviderRegistration.RegisterAll (cognitive 16) engine/src/CodeHealth.Cli/Composition/LlmProviderRegistration.cs:27— LlmProviderRegistration.RegisterAll has cognitive complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 106, 72). 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.
EngineeringReportRenderer.ConsolidateByRootCause (cognitive 16) engine/src/CodeHealth.Reporting/Engineering/EngineeringReportRenderer.cs:442— EngineeringReportRenderer.ConsolidateByRootCause has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReportViewModelFactory.BuildLensGlances (cognitive 16) engine/src/CodeHealth.Reporting/Templates/ReportViewModelFactory.cs:842— ReportViewModelFactory.BuildLensGlances has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicationAnalyzer.BuildDeclarationIndex (cognitive 16) engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:3444— DuplicationAnalyzer.BuildDeclarationIndex has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DependencyVulnerabilityAnalyzer.ParseVulnerabilitiesResult (cognitive 16) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityAnalyzer.cs:379— DependencyVulnerabilityAnalyzer.ParseVulnerabilitiesResult has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComposeServiceSurface.PublishesPortsFor (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:70— ComposeServiceSurface.PublishesPortsFor has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DuplicateResourceCopyAggregator.MetadataScalar (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/DuplicateResourceCopyAggregator.cs:283— DuplicateResourceCopyAggregator.MetadataScalar has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LoopbackAddressRecheck.LoopbackUrlOrInterpolatedLoopbackHost (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/LoopbackAddressRecheck.cs:53— LoopbackAddressRecheck.LoopbackUrlOrInterpolatedLoopbackHost has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NamespaceScopedRuleAggregator.IndexDeclaredKinds (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/NamespaceScopedRuleAggregator.cs:196— NamespaceScopedRuleAggregator.IndexDeclaredKinds has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathCombineProvenanceRecheck.ExtractCombineArgs (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/PathCombineProvenanceRecheck.cs:292— PathCombineProvenanceRecheck.ExtractCombineArgs has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PathContainmentRecheck.RandomValueNamesAFilePath (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/PathContainmentRecheck.cs:56— PathContainmentRecheck.RandomValueNamesAFilePath has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RubyArgumentMutatedScan.FirstDestructiveUse (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:513— RubyArgumentMutatedScan.FirstDestructiveUse has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RubyArgumentMutatedScan.ArgumentTextAt (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/RubyArgumentMutatedScan.cs:677— RubyArgumentMutatedScan.ArgumentTextAt has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretNoiseFilter.HasNonEmptyValue (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:4331— SecretNoiseFilter.HasNonEmptyValue has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SemgrepShapeFilter.TopLevelArguments (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/SemgrepShapeFilter.cs:429— SemgrepShapeFilter.TopLevelArguments has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnverifiedAppVeyorInstallerRecheck.InvokesADownloadedArtefact (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:216— UnverifiedAppVeyorInstallerRecheck.InvokesADownloadedArtefact has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
WorkflowInputGateRecheck.WorkflowInputIsGateValidated (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:33— WorkflowInputGateRecheck.WorkflowInputIsGateValidated has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WorkflowInputGateRecheck.CollectGatedInputs (cognitive 16) engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowInputGateRecheck.cs:457— WorkflowInputGateRecheck.CollectGatedInputs has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretScanningAnalyzer.RunAsync (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SecretScanningAnalyzer.cs:27— SecretScanningAnalyzer.RunAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretsHistoryAnalyzer.GateRustDocCommentFindings (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:790— SecretsHistoryAnalyzer.GateRustDocCommentFindings has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecretsHistoryAnalyzer.RustCfgTestRegions (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:1452— SecretsHistoryAnalyzer.RustCfgTestRegions has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SupplyChainProvenanceAnalyzer.ClassifyDependencySection (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1432— SupplyChainProvenanceAnalyzer.ClassifyDependencySection has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.ScanReleaseAutomation (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5619— SupplyChainProvenanceAnalyzer.ScanReleaseAutomation has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UnapprovedTagTriggeredPublishes (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:8278— SupplyChainProvenanceAnalyzer.UnapprovedTagTriggeredPublishes has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.CodeownersCoverageFor (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10434— SupplyChainProvenanceAnalyzer.CodeownersCoverageFor has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.BranchProtectionFor (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:10744— SupplyChainProvenanceAnalyzer.BranchProtectionFor has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SupplyChainProvenanceAnalyzer.UninvokedRegistryPublishPath (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PublishTrigger.cs:96— SupplyChainProvenanceAnalyzer.UninvokedRegistryPublishPath has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SupplyChainProvenanceAnalyzer.SupplementaryCiInvokesGoReleaser (cognitive 16) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.ReleaseTrigger.cs:158— SupplyChainProvenanceAnalyzer.SupplementaryCiInvokesGoReleaser has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.ReferencesFileByPathLiteral (cognitive 16) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3244— ChangeCouplingAnalyzer.ReferencesFileByPathLiteral has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChangeCouplingAnalyzer.RustEnumsOf (cognitive 16) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4096— ChangeCouplingAnalyzer.RustEnumsOf has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DocumentationQualityAnalyzer.RunAsync (cognitive 16) engine/src/CodeHealth.Dimensions.Docs/DocumentationQualityAnalyzer.cs:26— DocumentationQualityAnalyzer.RunAsync has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sparkline.razor › Runs (cognitive 16) src/Kennel.Ui/Components/Sparkline.razor:73— Sparkline.razor › Runs has cognitive complexity 16 (threshold 15). 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.
FSharpSyntaxModel.abstractSlotOf (cognitive 16) engine/src/CodeHealth.CodeModel.FSharp/SyntaxModel.fs:353— FSharpSyntaxModel.abstractSlotOf has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 3 (7 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.
main.parse_project (cognitive 16) engine/sidecars/python-frontend/main.py:428— main.parse_project has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (6 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 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.
build-quality-pairs-v2.mix_conventions (cognitive 16) tools/llm-bakeoff/build-quality-pairs-v2.py:73— build-quality-pairs-v2.mix_conventions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
head2head.run (cognitive 16) tools/llm-bakeoff/head2head.py:59— head2head.run has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 3 (7 pts), boolean chains 4, loops 2 (3 pts), if/else 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bench.grade (cognitive 16) tools/qwen-eval/bench.py:263— bench.grade has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, ternaries 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
bench.report (cognitive 16) tools/qwen-eval/bench.py:292— bench.report has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
advisory.drift (cognitive 16) tools/rescan/advisory.py:62— advisory.drift has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check_submission_verdict.main (cognitive 16) tools/train/check_submission_verdict.py:39— check_submission_verdict.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 4, loops 2, error handling 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
dimension-routing._backlog_rows (cognitive 16) tools/train/dimension-routing.py:260— dimension-routing._backlog_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), ternaries 2 (4 pts), boolean chains 3, error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
judge-with-tools.main (cognitive 16) tools/train/judge-with-tools.py:205— judge-with-tools.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 1, ternaries 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.
scope-evidence.graph_evidence (cognitive 16) tools/train/scope-evidence.py:93— scope-evidence.graph_evidence has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), error handling 2 (4 pts), boolean chains 3, loops 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
w2_catalogue_check.main (cognitive 16) tools/whitepapers/w2_catalogue_check.py:44— w2_catalogue_check.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 4 (5 pts), ternaries 3, boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BodyFacts.argTypeRefs (cognitive 16) engine/sidecars/php-frontend/body.php:510— BodyFacts.argTypeRefs has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Extractor.branchDecls (cognitive 16) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Extractor.swift:240— Extractor.branchDecls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Modifiers.memberModifiers (cognitive 16) engine/sidecars/swift-frontend/Sources/codehealth-swift-sidecar/Extractor.swift:496— Modifiers.memberModifiers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
(anonymous) (cognitive 16) src/Kennel.Ui/wwwroot/kennel-ui.js:1771— (anonymous) has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 5, ternaries 3 (4 pts) (nesting depth added 1). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (apply, initTeamPicker::(anonymous), initTeamPicker, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity· main (cognitive 16) · ×1
main (cognitive 16) tools/localdev/ui/a11y-gate.mjs:146— main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (4 pts), ternaries 2 (4 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: IMetricsWriter.cs → IMetricsReader.cs, MetricPoint.cs, MetricsReader.cs src/Kennel.Core/Metrics/Contracts/IMetricsWriter.cs— `src/Kennel.Core/Metrics/Contracts/IMetricsWriter.cs` changes together with 3 other files — `src/Kennel.Core/Metrics/Contracts/IMetricsReader.cs`, `src/Kennel.Core/Metrics/Domain/MetricPoint.cs`, `src/Kennel.Core/Metrics/MetricsReader.cs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Unpinned build actions — CI references GitHub Actions by a floating ref (@main / @tag) rather than a pinned commit SHA, weakening build integrity. 1 floating ref(s) across 1 workflow file(s). Each floating ref is itemized at file:line by the SAST (D29) lens.
Near-duplicate member pair (114 shared lines) engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:26— engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:26-171 | engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:26-176 — These two members are variants of one another: 114 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (85 shared lines) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1578— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:1578-1712 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4982-5170 — These two members are variants of one another: 85 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (51 shared lines) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:288— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:288-373 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1635-1743 — These two members are variants of one another: 51 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×1
Edited copy of a member (17 corresponding lines) engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:123— engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:123-148 | engine/src/CodeHealth.Reporting/Security/SecurityWatchRenderer.cs:155-174 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:442— engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:442-491 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1489-1547 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1559-1616 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:446-504 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:585-649 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:920-976 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1193-1247 | engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:512-545 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:375-417 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:427-459 — These 10 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 10 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 10 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4002— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4002-4023 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4062-4072 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4127-4138 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4221-4235 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4315-4341 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4560-4579 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4606-4619 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4646-4658 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4687-4702 — These 9 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 9 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 9 times.
Duplicated block (34–108 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:198— engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:198-231 | engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:437-544 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.GitMining/KnowledgeConcentrationAnalyzer.cs:437` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (68–76 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:499— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:499-574 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1200-1267 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:499` 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 (68–70 lines × 3) engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:48— engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:48-117 | engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:52-119 | engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:55-122 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs` and `engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 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 `engine/src/CodeHealth.Core/ModelAware/AltTextQualityAnalyzer.cs:48` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (46–61 lines × 2) engine/src/CodeHealth.History/RunSidecar.cs:100— engine/src/CodeHealth.History/RunSidecar.cs:100-145 | engine/src/CodeHealth.Reporting/RunReport.cs:68-128 — 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 (50–51 lines × 2) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:127— engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:127-176 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:167-217 — 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 `engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33–47 lines × 2) engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:119— engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:119-165 | engine/src/CodeHealth.Core/Architecture/BoundaryCouplingDetector.cs:338-370 — both copies are in the same file, so extract the 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 (39–43 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5430— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5430-5472 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5512-5550 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5430` 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 (31–40 lines × 3) engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:133— engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:133-172 | engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:341-371 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:171-210 — 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 `engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:133` 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 (34–40 lines × 2) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1492— engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1492-1531 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1195-1228 — 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 `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24–39 lines × 2) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:873— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:873-896 | engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1054-1092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (38 lines × 2) engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:176— engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:176-213 | engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs:158-195 — 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 (36–38 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:467— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:467-504 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:5241-5276 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18–37 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1125— engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1125-1161 | engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1705-1722 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (32–37 lines × 2) engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:187— engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:187-223 | engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:265-296 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Scoring/CodebaseSize.cs:187` 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. 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. 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 (35 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4282— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4282-4316 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4407-4441 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4282` 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. 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 (34 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2918— engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2918-2951 | engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3009-3042 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:2918` 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. 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. 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 (29–34 lines × 2) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:568— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:568-596 | engine/src/CodeHealth.Dimensions.GitMining/HotspotAnalyzer.cs:736-769 — 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 (27–33 lines × 3) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499— engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499-1531 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1569-1601 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1202-1228 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:172— engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:172-204 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs:127-159 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedShellInstallerRecheck.cs:128-160 — before extracting anything, compare `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs` and `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 69 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:172` 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. 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. 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 (28–33 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:947— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:947-979 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:1599-1626 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:947` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (32–33 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs:348— engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs:348-380 | engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs:421-452 — both copies are in the same file, so extract the 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 first that the copies are not typed on the same thing: the declarations holding them bind `null` to `IReadOnlyList<(ScanRun Run, int FindingCount)>? passes =` in one and `IReadOnlyList<ScanFinding>? scoredSubset =` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (32 lines × 2) engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:427— engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:427-458 | engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:557-588 — 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 (29–32 lines × 2) engine/src/CodeHealth.Reporting/Sarif/SarifReportRenderer.cs:88— engine/src/CodeHealth.Reporting/Sarif/SarifReportRenderer.cs:88-119 | engine/src/CodeHealth.Reporting/Sarif/SarifReportRenderer.cs:150-178 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Reporting/Sarif/SarifReportRenderer.cs:88` 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 (25–31 lines × 5) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499— engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499-1529 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1569-1599 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:458-482 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:597-621 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1202-1226 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1499` 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 (29–31 lines × 2) engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:75— engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:75-103 | engine/src/CodeHealth.Dimensions.Security/Scanners/EolActionMajorRepositoryFold.cs:168-198 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/DependencyUpdateCooldownCollapse.cs:75` 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 (30 lines × 6) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:215— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:215-244 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:320-349 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:639-668 | engine/src/CodeHealth.Dimensions.Security/Scanners/NamelessWorkloadPrivilegedScan.cs:284-313 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubySourceFiles.cs:54-83 | engine/src/CodeHealth.Dimensions.Security/Scanners/WranglerPlaintextVarScan.cs:415-444 — 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 6 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:215` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `lines` to `string[]` in one and `IReadOnlyList<string>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (28–30 lines × 2) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1394— engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1394-1423 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1433-1460 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1394` 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 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 (26–30 lines × 2) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:248— engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:248-277 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:655-680 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–29 lines × 5) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3658— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3658-3686 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3984-3999 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4029-4044 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4077-4096 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4130-4144 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3658` 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. 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 (22–29 lines × 4) engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:90— engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:90-111 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1395-1423 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1434-1460 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1469-1495 — there are 4 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 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 `engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1395` 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. 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 (29 lines × 3) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:938— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:938-966 | engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:380-408 | engine/src/CodeHealth.Core/Frontend/NonProductionTreeReadmission.cs:169-197 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:938` 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. 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 (28–29 lines × 2) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93-120 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:85-113 — 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 `engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:91` calls `CommonDirectoryPrefixLength` and `engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:81` 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 (27–29 lines × 2) engine/src/CodeHealth.Core/Dependencies/GradleCurrencyCollector.cs:103— engine/src/CodeHealth.Core/Dependencies/GradleCurrencyCollector.cs:103-131 | engine/src/CodeHealth.Core/Dependencies/MavenCurrencyCollector.cs:112-138 — 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 `engine/src/CodeHealth.Core/Dependencies/GradleCurrencyCollector.cs:103` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25–29 lines × 2) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1459— engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1459-1487 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5834-5858 — 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 `engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1459` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (22–29 lines × 2) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:452— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:452-480 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:1162-1183 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:452` 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 (19–27 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:333— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:333-359 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1711-1729 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:333` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `type` to `INamedTypeSymbol` in one and `Nm.ICodeType` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (25–27 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:771— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:771-797 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2238-2262 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:771` 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. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (26 lines × 4) engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:385— engine/src/CodeHealth.Core/CodeShape/ChainedCorrespondence.cs:385-410 | engine/src/CodeHealth.Core/CodeShape/ChainedFamilyRollup.cs:341-366 | engine/src/CodeHealth.Core/CodeShape/MemberFamilyRollup.cs:530-555 | engine/src/CodeHealth.Core/CodeShape/MemberPairRollup.cs:206-231 — 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. 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 (26 lines × 3) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5356— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5356-5381 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5511-5536 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5889-5914 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5356` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21–26 lines × 2) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:589— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:589-614 | engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs:50-70 — 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 `engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:589` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (26 lines × 2) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6026— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6026-6051 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6095-6120 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6026` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `root` to `string` in one and `int Files) CountProgrammaticDomFactoryCalls(string` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–26 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1989— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1989-2003 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:9277-9302 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:1989` 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. 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 (25 lines × 5) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1768— engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1768-1793 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1895-1919 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1977-2003 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2053-2079 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2276-2303 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:1768` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (25 lines × 4) engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:429— engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:429-453 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5978-6002 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6221-6245 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9933-9957 — there are 4 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 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 `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:429` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–25 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3863— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3863-3873 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:4348-4372 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:3863` 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. 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 (22–25 lines × 2) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CognitiveComplexityAnalyzer.cs:24— engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CognitiveComplexityAnalyzer.cs:24-48 | engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CyclomaticComplexityAnalyzer.cs:25-46 — 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 `engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CognitiveComplexityAnalyzer.cs:24` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–24 lines × 2) engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:221— engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:221-244 | engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:399-410 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Complexity/ControlFlowComplexity.cs:221` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (22–24 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:706— engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:706-729 | engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:2067-2088 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainModelAnalyzer.cs:706` 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 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 (20–24 lines × 2) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:172— engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:172-195 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:345-364 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:172` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18–24 lines × 2) engine/src/CodeHealth.Dimensions.Architecture/BoundaryCouplingAnalyzer.cs:332— engine/src/CodeHealth.Dimensions.Architecture/BoundaryCouplingAnalyzer.cs:332-349 | engine/src/CodeHealth.Dimensions.Architecture/CohesionAnalyzer.cs:87-110 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Architecture/BoundaryCouplingAnalyzer.cs:332` 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. 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. 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 (23–24 lines × 2) engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7314— engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7314-7336 | engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7422-7445 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:7314` 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 (20–23 lines × 3) engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:286— engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:286-307 | engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:227-249 | engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:243-262 — 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 `engine/src/CodeHealth.Core/Dependencies/GoModuleHygiene.cs:286` 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. 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 (13–23 lines × 3) engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:95— engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:95-107 | engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs:150-172 | engine/src/CodeHealth.Core/ModelAware/SupplyChainHygieneAnalyzer.cs:372-390 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs` and `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/TestFrameworkDetector.cs` as WHOLE FILES: this scan already matched 3 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. 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 `engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:95` 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. 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. 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 (23 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:145— engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:145-167 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs:100-122 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedShellInstallerRecheck.cs:97-119 — before extracting anything, compare `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs` and `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedPowerShellInstallerRecheck.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 69 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedAppVeyorInstallerRecheck.cs:145` 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. 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 (17–23 lines × 2) engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2140— engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2140-2156 | engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2200-2222 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Dependencies/DependencyHygieneAnalyzer.cs:2140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19–23 lines × 2) engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:307— engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:307-329 | engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1689-1707 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:307` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–23 lines × 2) engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:175— engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:175-197 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:127-144 — 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 `engine/src/CodeHealth.Core/Scoring/DeclaredScriptExecutables.cs:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–22 lines × 7) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443— engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443-464 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1497-1514 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1567-1584 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1200-1214 | engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:513-527 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:383-397 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:428-442 — there are 7 copies across 6 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 7 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:426` calls `RustFiles` and `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1495` 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 (16–22 lines × 6) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1372— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1372-1387 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1437-1452 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1502-1517 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1555-1576 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1602-1617 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1848-1863 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1372` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–22 lines × 3) engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2054— engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2054-2068 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2115-2129 | engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2176-2197 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/EventDrivenAnalyzer.cs:2054` 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. 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 (20–22 lines × 2) engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:617— engine/src/CodeHealth.Core/ModelAware/DartDomainConventions.cs:617-636 | engine/src/CodeHealth.Core/ModelAware/SwiftDomainConventions.cs:1149-1170 — 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 (19–22 lines × 2) engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:26— engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:26-44 | engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs:26-47 — before extracting anything, compare `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs` and `engine/src/CodeHealth.Core/ModelAware/LinkTextQualityAnalyzer.cs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 119 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 `engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:26` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21–22 lines × 2) engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40— engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40-61 | engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs:39-59 — before extracting anything, compare `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs` and `engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21 lines × 6) engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1457— engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1457-1477 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:427-447 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5832-5852 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5976-5996 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6219-6239 | engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:9931-9951 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1457` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TemplateLanguageBlindness.cs:450` calls `Sort` and `engine/src/CodeHealth.Core/Markup/MarkupParser.cs:1480` 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 (21 lines × 5) engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:947— engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:947-967 | engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:389-409 | engine/src/CodeHealth.Core/Frontend/FrontendTestSuiteMasking.cs:819-839 | engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:124-144 | engine/src/CodeHealth.Core/Frontend/NonProductionTreeReadmission.cs:178-198 — 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 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:947` 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. 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 (18–21 lines × 2) engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:373— engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:373-390 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:728-748 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:373` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18–20 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:566— engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:566-583 | engine/src/CodeHealth.Core/Frontend/FrontendSpecifierScanning.cs:28-47 — 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 `engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:566` 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 (17–20 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4252— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4252-4271 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5477-5493 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4252` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (11–20 lines × 2) engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CognitiveComplexityAnalyzer.cs:36— engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CognitiveComplexityAnalyzer.cs:36-55 | engine/src/CodeHealth.Dimensions.CodeQuality/Complexity/CyclomaticComplexityAnalyzer.cs:73-83 — 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 (13–19 lines × 2) engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:144— engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:144-162 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:309-321 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs: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. Note first that the copies are not typed on the same thing: the declarations holding them bind `types` to `IReadOnlyList<INamedTypeSymbol>` in one and `IReadOnlyList<Nm.ICodeType>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–18 lines × 8) src/Kennel.Watchdog.Core/Agents/Ui/RepoDiagnosis.razor:110— src/Kennel.Watchdog.Core/Agents/Ui/RepoDiagnosis.razor:110-124 | src/Kennel.Watchdog.Core/Agents/Ui/RepoFindings.razor:689-703 | src/Kennel.Watchdog.Core/Architecture/Ui/RepoArchitecture.razor:168-182 | src/Kennel.Watchdog.Core/Architecture/Ui/RepoDependencyMatrix.razor:125-139 | src/Kennel.Watchdog.Core/Calibration/Ui/RepoIntegrations.razor:172-186 | src/Kennel.Watchdog.Core/Gallery/Ui/RepoCommunityTags.razor:157-174 | src/Kennel.Watchdog.Core/Reporting/Ui/RepoChangelog.razor:261-275 | src/Kennel.Watchdog.Core/Reporting/Ui/RepoSystemOverview.razor:108-122 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 8 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 8 times. Read the line range as the matched WINDOW rather than a finished unit: at `src/Kennel.Watchdog.Core/Agents/Ui/RepoDiagnosis.razor:110` 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. 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 (18 lines × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:112— engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:112-129 | engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:82-99 | engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:58-75 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:91-108 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:112` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–18 lines × 3) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:224— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:224-241 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:161-174 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:199-212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:161` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (16–18 lines × 3) engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3252— engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3252-3269 | engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1523-1538 | engine/src/CodeHealth.Dimensions.Security/Scanners/RubyDuplicateMethodDefinitionScan.cs:293-308 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3252` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:3249` calls `ContainsAwaitWord` and `engine/src/CodeHealth.Core/ModelAware/MutationIdempotencyAnalyzer.cs:1521` 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 (14–18 lines × 2) engine/src/CodeHealth.History/RunSidecar.cs:92— engine/src/CodeHealth.History/RunSidecar.cs:92-105 | engine/src/CodeHealth.Reporting/RunReport.cs:222-239 — 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. 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 (15–17 lines × 2) engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:162— engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:162-178 | engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:246-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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/RuntimeAccessibility/BootedAppRenderer.cs:162` 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 (16 lines × 6) engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1512— engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1512-1530 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1582-1600 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:468-483 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:607-622 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:946-961 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1212-1227 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1512` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:944` calls `IsTestsDir`, `HasConventionalTestDirSegment` and `engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1510` 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 (15–16 lines × 3) engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:173— engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:173-188 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:251-265 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:300-314 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:173` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–16 lines × 2) engine/src/CodeHealth.Core/Dependencies/HexVersion.cs:193— engine/src/CodeHealth.Core/Dependencies/HexVersion.cs:193-208 | engine/src/CodeHealth.Core/Dependencies/NpmVersion.cs:93-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Dependencies/HexVersion.cs:193` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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. 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 (14–16 lines × 2) engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:748— engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:748-761 | engine/src/CodeHealth.Core/Frontend/ModuleResolver.cs:768-783 — both copies are in the same file, so extract the 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–16 lines × 2) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4798— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4798-4813 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4898-4907 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (11–15 lines × 5) engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:45— engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:45-58 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:140-154 | engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:344-354 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:178-192 | engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:66-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 all 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:45` 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 × 4) engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:195— engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:195-209 | engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeServiceSurface.cs:300-314 | engine/src/CodeHealth.Dimensions.Security/Scanners/DockerfileSyntax.cs:619-633 | engine/src/CodeHealth.Dimensions.Security/Scanners/WranglerPlaintextVarScan.cs:395-409 — 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 `engine/src/CodeHealth.Dimensions.Security/Scanners/ComposeRuntimeSocketMountScan.cs:195` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4453— engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:4453-4467 | engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5657-5670 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/JsDuplicationDetector.cs:5657` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–15 lines × 2) engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:180— engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:180-194 | engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:306-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 `engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityUnion.cs:180` 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 (14 lines × 4) engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:572— engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:572-585 | engine/src/CodeHealth.Core/ModelAware/PhpDomainConventions.cs:544-557 | engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:555-568 | engine/src/CodeHealth.Core/ModelAware/RubyDomainConventions.cs:726-739 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/ModelAware/PythonDomainConventions.cs:572` calls `IsDunder`, `StartsWith`, `EndsWith` and `engine/src/CodeHealth.Core/ModelAware/JavaDomainConventions.cs:589` 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 (14 lines × 3) engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:839— engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:839-852 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:899-912 | engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:960-973 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/EventSourcingAnalyzer.cs:839` 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. 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 (12–14 lines × 2) engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:548— engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:548-561 | engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:2080-2091 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/ArchitectureModelAnalyzer.cs:548` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 3) engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1457— engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:1457-1469 | engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:2630-2642 | engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:4298-4309 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–13 lines × 2) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3979— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3979-3989 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:4005-4017 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:3979` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `sites` to `List<(string Type, string FilePath, int Line)>` in one and `List<(string Setting, string Member, string FilePath, int Line)>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8–13 lines × 2) engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:332— engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:332-344 | engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:359-366 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Dimensions.Architecture/CouplingAnalyzer.cs:332` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note 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 (9–12 lines × 4) engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2080— engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2080-2091 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2182-2193 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2421-2432 | engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2534-2542 — 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 `engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:2080` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1667— engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1667-1678 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1716-1727 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1775-1787 | engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1811-1822 — 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 `engine/src/CodeHealth.Cli/Commands/JvmSidecar.cs:1667` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–12 lines × 2) engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:402— engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:402-411 | engine/src/CodeHealth.Dimensions.Security/Scanners/OsvScannerIgnores.cs:386-397 — 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 `engine/src/CodeHealth.Core/Dependencies/MixManifestHygiene.cs:402` 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 (6–11 lines × 11) engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:72— engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:72-78 | engine/src/CodeHealth.Core/ModelAware/CoherenceSmellAnalyzer.cs:43-52 | engine/src/CodeHealth.Core/ModelAware/DataShapeSmellAnalyzer.cs:35-41 | engine/src/CodeHealth.Core/ModelAware/GdprPersonalDataAnalyzer.cs:77-82 | engine/src/CodeHealth.Core/ModelAware/JsInteropContractAnalyzer.cs:48-53 | engine/src/CodeHealth.Core/ModelAware/LogicDefectAnalyzer.cs:138-148 | engine/src/CodeHealth.Core/ModelAware/MarkupTaintPass.cs:342-348 | engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:33-39 | engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:98-103 | engine/src/CodeHealth.Core/ModelAware/SecurityDefectAnalyzer.cs:176-186 | engine/src/CodeHealth.Core/ModelAware/StringContractSmellAnalyzer.cs:64-73 — 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 11 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `engine/src/CodeHealth.Core/ModelAware/RepoProfiler.cs:93` calls `DetectAsync`, `ConfigureAwait` and `engine/src/CodeHealth.Core/ModelAware/GdprPersonalDataAnalyzer.cs:75` 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 × 8) engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443— engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443-457 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1497-1510 | engine/src/CodeHealth.Core/Scoring/DiskSourceFiles.cs:1567-1580 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:932-942 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:1200-1210 | engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:513-523 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:383-393 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:428-438 — there are 8 copies across 6 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 8 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:443` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:944` calls `IsTestsDir`, `HasConventionalTestDirSegment` and `engine/src/CodeHealth.Core/Compliance/HostedHttpSurfaceScan.cs:460` 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 (10 lines × 6) engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349— engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349-358 | engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:381-390 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:113-122 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:882-891 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1331-1340 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:1376-1385 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:349` 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–10 lines × 5) engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:117— engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:117-124 | engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:126-135 | engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:144-151 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:271-280 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:130-137 — 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 5 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 (9–10 lines × 3) engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3843— engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3843-3851 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3890-3898 | engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:4403-4412 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.GitMining/ChangeCouplingAnalyzer.cs:3843` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) src/Kennel.Core/Compliance/Ui/ComplianceActivation.razor:150— src/Kennel.Core/Compliance/Ui/ComplianceActivation.razor:150-159 | src/Kennel.Core/Compliance/Ui/Declarations.razor:118-126 — 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–9 lines × 7) engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4127— engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4127-4134 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4221-4228 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4315-4322 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4560-4567 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4606-4613 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4646-4653 | engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4687-4695 — all 7 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 `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4127` 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. 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4656` calls `Contains` and `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4137` 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 (8–9 lines × 3) engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40— engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40-48 | engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs:39-46 | engine/src/CodeHealth.Llm.OpenAiCompatible/OpenAiCompatibleLlmProvider.cs:123-131 — before extracting anything, compare `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs` and `engine/src/CodeHealth.Llm.CopilotCli/CopilotCliLlmProvider.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 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 `engine/src/CodeHealth.Llm.ClaudeCli/ClaudeCliLlmProvider.cs:40` 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. 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. 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 (8–9 lines × 2) engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:914— engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:914-922 | engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:1003-1010 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/ModelAware/RustDomainConventions.cs:914` 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–8 lines × 3) engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:509— engine/src/CodeHealth.Core/CodeModel/Roslyn/CSharpCloneTokenizer.cs:509-516 | engine/src/CodeHealth.Core/CodeModel/Roslyn/CloneMemberContract.cs:28-33 | engine/src/CodeHealth.Core/CodeModel/Roslyn/VbCloneTokenizer.cs:229-236 — 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 `engine/src/CodeHealth.Core/CodeModel/Roslyn/CloneMemberContract.cs: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. 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 (7 lines × 6) engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:214— engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:214-220 | engine/src/CodeHealth.Core/Dependencies/HexRegistryClient.cs:179-185 | engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:193-199 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:192-198 | engine/src/CodeHealth.Core/Dependencies/RubyGemsRegistryClient.cs:327-333 | engine/src/CodeHealth.Core/Dependencies/UnityRegistryClient.cs:184-190 — there are 6 copies across 5 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 6 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Dependencies/GoProxyClient.cs:214` 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. 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. 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 (7 lines × 5) engine/src/CodeHealth.Dimensions.Security/Scanners/PrivateKeyBlobHistoryScan.cs:532— engine/src/CodeHealth.Dimensions.Security/Scanners/PrivateKeyBlobHistoryScan.cs:532-538 | engine/src/CodeHealth.Dimensions.Security/SecretsHistoryAnalyzer.cs:2424-2430 | engine/src/CodeHealth.Toolchain/Git/GitDiffShapes.cs:479-485 | engine/src/CodeHealth.Toolchain/Git/GitLogHistoryExtractor.cs:254-260 | engine/src/CodeHealth.Toolchain/Git/LibGit2GitAccessor.cs:351-357 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. 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 (6 lines × 6) engine/src/CodeHealth.Dimensions.Architecture/BoundaryScopeJudge.cs:70— engine/src/CodeHealth.Dimensions.Architecture/BoundaryScopeJudge.cs:70-75 | engine/src/CodeHealth.Dimensions.Architecture/Llm/LlmApiConsistencyEvaluator.cs:81-86 | engine/src/CodeHealth.Dimensions.Architecture/Llm/LlmProjectCohesionEvaluator.cs:59-64 | engine/src/CodeHealth.Dimensions.Docs/Llm/PromptResource.cs:12-17 | engine/src/CodeHealth.Reporting/Changelog/ChangelogNarrator.cs:908-913 | engine/src/CodeHealth.Reporting/Prose/LlmReportProseGenerator.cs:255-260 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 6 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 6 times. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Dimensions.Architecture/BoundaryScopeJudge.cs:70` 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 (7 lines × 4) engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:402— engine/src/CodeHealth.Core/Frontend/FrontendConfigResolution.cs:402-417 | engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:439-454 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5148-5157 | engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:5551-5557 — 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. 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 (11 lines × 14) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:95— engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:95-105 | engine/src/CodeHealth.Dimensions.Security/Scanners/BuildTimeKeyMaterialScan.cs:130-140 | engine/src/CodeHealth.Dimensions.Security/Scanners/EndOfLifeBaseImageScan.cs:162-172 | engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:65-75 | engine/src/CodeHealth.Dimensions.Security/Scanners/InsecureTransportFetchScan.cs:117-127 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableBaseImageScan.cs:83-93 | engine/src/CodeHealth.Dimensions.Security/Scanners/MutableGitCloneScan.cs:71-81 | engine/src/CodeHealth.Dimensions.Security/Scanners/NoOpToolShimScan.cs:88-98 | engine/src/CodeHealth.Dimensions.Security/Scanners/PythonInstallGuardDisabledScan.cs:79-89 | engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:41-51 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnpinnedToolchainInstallScan.cs:192-202 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedRemoteInstallerScan.cs:546-556 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnverifiedTrustAnchorScan.cs:114-124 | engine/src/CodeHealth.Dimensions.Security/Scanners/WorldWritableOwnedPathScan.cs:74-84 — 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. 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 (9 lines × 5) engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:483— engine/src/CodeHealth.Dimensions.Security/Scanners/BrowserSandboxDisabledScan.cs:483-491 | engine/src/CodeHealth.Dimensions.Security/Scanners/GitOwnershipCheckDisabledScan.cs:199-207 | engine/src/CodeHealth.Dimensions.Security/Scanners/PythonInstallGuardDisabledScan.cs:268-276 | engine/src/CodeHealth.Dimensions.Security/Scanners/SetuidBinaryGrantScan.cs:203-211 | engine/src/CodeHealth.Dimensions.Security/Scanners/UnscopedBuildContextCopyScan.cs:421-429 — 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 5 call sites, so a change lands once.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×1
Edited copy of a member (8 corresponding lines) engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:734— engine/src/CodeHealth.Core/Testing/NodeTestReliabilityCollector.cs:734-741 | engine/src/CodeHealth.Core/Testing/NodeTestSuiteCoverageCollector.cs:789-796 — 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.
Duplicated block (40 lines × 2) engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:446— engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:446-485 | engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:585-624 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Testing/DiskTestScanner.cs:446` 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 (31 lines × 4) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:362— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:362-392 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:231-261 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:260-290 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:339-369 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:294` calls `HasDistributionManifest`, `Any`, `Exists` and `engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:269` 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 (24–26 lines × 2) engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1400— engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1400-1423 | engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1494-1519 — both copies are in the same file, so extract the 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 `engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs:1400` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (18 lines × 5) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:100— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:100-117 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:82-99 | engine/src/CodeHealth.Core/Testing/JsTestQualityCensus.cs:94-111 | engine/src/CodeHealth.Core/Testing/PythonTestCensus.cs:87-104 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:89-106 — 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 5 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:100` 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. 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 (17–18 lines × 3) engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:233— engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:233-250 | engine/src/CodeHealth.Core/Testing/JsTestCensus.cs:164-180 | engine/src/CodeHealth.Core/Testing/RustTestCensus.cs:197-213 — 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 `engine/src/CodeHealth.Core/Testing/GoTestCensus.cs:233` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2 locations) engine/docker/analyzer/render/axe-render.mjs:227— engine/docker/analyzer/render/axe-render.mjs:227 · engine/docker/analyzer/render/observe-proxy.mjs:89 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (10 matched lines × 2 locations) · ×1
Duplicated block with local edits (10 matched lines × 2 locations) tools/localdev/ui/corpus-e2e.mjs:891— tools/localdev/ui/corpus-e2e.mjs:891 · tools/localdev/ui/corpus-e2e.mjs:904 — the two spans are one implementation copied and then locally edited — 86 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (9 lines × 2 locations) engine/docker/analyzer/render/observe-proxy.mjs:88— engine/docker/analyzer/render/observe-proxy.mjs:88 · tools/localdev/ui/lib/cli.mjs:23 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication· Duplicated block with local edits (6 matched lines × 2 locations) · ×1
Duplicated block with local edits (6 matched lines × 2 locations) engine/sidecars/ruby-frontend/body-facts.mjs:129— engine/sidecars/ruby-frontend/body-facts.mjs:129 · engine/sidecars/ruby-frontend/file-extractor.mjs:191 — the two spans are one implementation copied and then locally edited — 56 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (5 matched lines × 2 locations) · ×1
Duplicated block with local edits (5 matched lines × 2 locations) engine/sidecars/ruby-frontend/project.mjs:39— engine/sidecars/ruby-frontend/project.mjs:39 · engine/sidecars/ruby-frontend/project.mjs:51 — the two spans are one implementation copied and then locally edited — 53 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 43, cognitive 67) · ×1
Complex function main (cyclomatic 43, cognitive 67) tools/localdev/ui/corpus-e2e.mjs:739— main has cyclomatic complexity 43 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function inspect (cyclomatic 24, cognitive 27) tools/localdev/ui/corpus-e2e.mjs:536— inspect has cyclomatic complexity 24 and cognitive complexity 27; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function walk (cyclomatic 21, cognitive 22) · ×1
Complex function walk (cyclomatic 21, cognitive 22) tools/localdev/ui/corpus-e2e.mjs:455— walk has cyclomatic complexity 21 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 11) tools/localdev/e2e/compliance-scope-parity.cjs:28— (anonymous) has cyclomatic complexity 14 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 10) tools/localdev/e2e/repo-hub-hover.cjs:36— (anonymous) has cyclomatic complexity 14 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function stripStringsAndComments (cyclomatic 13, cognitive 18) engine/sidecars/tsjs-frontend/ts-helpers.mjs:106— stripStringsAndComments has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function walk (cyclomatic 12, cognitive 21) · ×1
Complex function walk (cyclomatic 12, cognitive 21) engine/sidecars/tsjs-frontend/ts-helpers.mjs:264— walk has cyclomatic complexity 12 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 12, cognitive 16) · ×1
Complex function main (cyclomatic 12, cognitive 16) tools/localdev/ui/a11y-gate.mjs:146— main has cyclomatic complexity 12 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function walk (cyclomatic 12, cognitive 15) · ×1
Complex function walk (cyclomatic 12, cognitive 15) tools/localdev/ui/corpus-e2e.mjs:649— walk has cyclomatic complexity 12 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function methodMember (cyclomatic 12, cognitive 12) engine/sidecars/ruby-frontend/members.mjs:15— methodMember has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function looksMinified (cyclomatic 12, cognitive 12) engine/sidecars/tsjs-frontend/ts-helpers.mjs:147— looksMinified has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function judgeShare (cyclomatic 12, cognitive 12) tools/localdev/ui/corpus-e2e.mjs:176— judgeShare has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 12, cognitive 11) tools/localdev/ui/corpus-e2e.mjs:352— (anonymous) has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function parseCsv (cyclomatic 11, cognitive 15) tools/localdev/ui/corpus-e2e.mjs:675— parseCsv has cyclomatic complexity 11 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function typeRefOfNode (cyclomatic 11, cognitive 11) engine/sidecars/tsjs-frontend/extract-file.mjs:130— typeRefOfNode has cyclomatic complexity 11 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~110 LoC) tools/train/backlog-sessions/01a09ba7-5207-791d-a102-a79db2fa205c/fixture-slice.ts— no import path from any entry point (39 application, 13 tooling, 149 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~12 LoC) tools/train/backlog-sessions/01a0755a-3825-7a5a-962d-5d54313f8058/bubbling-probe.mjs— no import path from any entry point (39 application, 13 tooling, 149 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
X18 · Disposal-pattern correctness· Disposable created and abandoned in the method that made it · ×1
Disposable created and abandoned in the method that made it engine/src/CodeHealth.Core/Roslyn/BuildlessCSharpProjects.cs:233— `workspace` is a `AdhocWorkspace`, which implements `IDisposable`, and it is created here (line 233). Every use of it in `Build` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var workspace = …;`), which releases it at the end of the scope on every path including a throw.
X5 · Nullable reference types· Null guard scopes only part of the work it protects · ×1
Null guard scopes only part of the work it protects engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:7221— This method contradicts itself about `unreadStrings`: line 7186 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 7221 then dereferences `unreadStrings` as `unreadStrings.Examples` AFTER the block has closed, where the guard no longer applies. A null `unreadStrings` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `unreadStrings` truly cannot be null by then, the guard above is misleading and should go.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×1
Symbol treated as nullable, then dereferenced unguarded engine/src/CodeHealth.Dimensions.CodeQuality/CodeShape/DuplicationAnalyzer.cs:163— This method contradicts itself about `model`: line 162 writes `model?.`, which says `model` can be null, but line 163 then dereferences it directly as `model.CloneUnits` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `model` truly cannot be null here, the `?.` is misleading. Settle it one way — test `model` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Duplicated predicate engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs:277— `!dir.EndsWith(".xcodeproj", StringComparison.OrdinalIgnoreCase) && !dir.EndsWith(".xcworkspace", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Dependencies/SwiftPackageHygiene.cs, engine/src/CodeHealth.Core/Discovery/UnreadManifestDisclosure.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs:53— `!doc.RootElement.TryGetProperty("packages", out var packages) || packages.ValueKind != JsonValueKind.Object` appears character-identically in 3 files — engine/src/CodeHealth.Core/Frontend/FrontendDeclaredPackageRefs.cs, engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs, engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs. 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 engine/src/CodeHealth.Dimensions.Security/RuntimeHardeningScan.cs:133— `!ext.Equals(".yaml", StringComparison.OrdinalIgnoreCase) && !ext.Equals(".yml", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Dimensions.Security/RuntimeHardeningScan.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs. 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 engine/src/CodeHealth.Core/FileQuality/ReleaseEvidence.cs:137— `!n.Contains("/bin/", StringComparison.OrdinalIgnoreCase) && !n.Contains("/obj/", StringComparison.OrdinalIgnoreCase) && !n.Contains("/node_m…` appears character-identically in 2 files — engine/src/CodeHealth.Core/FileQuality/ReleaseEvidence.cs, engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs. 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 engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:323— `!range.TryGetProperty("events", out var events) || events.ValueKind != JsonValueKind.Array` appears character-identically in 2 files — engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs:1004— `!specifier.StartsWith("./", StringComparison.Ordinal) && !specifier.StartsWith("../", StringComparison.Ordinal)` appears character-identically in 3 files — engine/src/CodeHealth.Core/Frontend/FrontendBoundaries.cs, engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs, engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs:634— `!string.Equals(ext, ".yml", StringComparison.OrdinalIgnoreCase) && !string.Equals(ext, ".yaml", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendToolAndRuntimeRefs.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/WorkflowTriggerRecheck.cs. 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 engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs:56— `!string.Equals(finding.RuleId, RuleId, StringComparison.Ordinal) && !(finding.RuleId ?? string.Empty).EndsWith("." + RuleId, StringCompariso…` appears character-identically in 4 files — engine/src/CodeHealth.Dimensions.Security/Scanners/DartDeadPrivateFieldRecheck.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/JsRedundantReDefaultRecheck.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs. 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 engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:227— `!tag.IsWord("html") && !tag.IsWord("svg")` appears character-identically in 2 files — engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs, engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.TaggedTemplateBlindness.cs. 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 engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs:294— `!vuln.TryGetProperty("affected", out var affected) || affected.ValueKind != JsonValueKind.Array` appears character-identically in 2 files — engine/src/CodeHealth.Core/Dependencies/OsvAdvisoryClient.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/ScanParsers.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:419— `dir.Length == 0 || file.StartsWith(dir + "/", StringComparison.Ordinal)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs, engine/src/CodeHealth.Core/ModelAware/TemplateDetection.cs. 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 engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs:276— `doc.FilePath is not { } path || !path.EndsWith(".cs", StringComparison.OrdinalIgnoreCase)` appears character-identically in 5 files — engine/src/CodeHealth.Core/Architecture/ContainerDetector.cs, engine/src/CodeHealth.Core/ExplicitDebt/MarkdownSnippetReferenceScanner.cs, engine/src/CodeHealth.Core/ModelAware/AppKindDetector.cs, engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs. 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 engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs:136— `doc.RootElement.ValueKind != JsonValueKind.Object || !doc.RootElement.TryGetProperty("dependencies", out var deps) || deps.ValueKind != Json…` appears character-identically in 2 files — engine/src/CodeHealth.Core/Dependencies/UnityLockfileReader.cs, engine/src/CodeHealth.Core/Dependencies/UnityPackageHygiene.cs. 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 engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs:27— `doc.RootElement.ValueKind != JsonValueKind.Object || !doc.RootElement.TryGetProperty("scripts", out var scripts) || scripts.ValueKind != Jso…` appears character-identically in 2 files — engine/src/CodeHealth.Core/ModelAware/RuntimeBoot/DevServerDetector.cs, engine/src/CodeHealth.Core/Readiness/VacuousFormatGate.cs. 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 engine/src/CodeHealth.Core/Compliance/PiiDataMap.cs:59— `document.FilePath is not { } path || !path.EndsWith(".cs", StringComparison.OrdinalIgnoreCase) || path.EndsWith(".g.cs", StringComparison.Or…` appears character-identically in 2 files — engine/src/CodeHealth.Core/Compliance/PiiDataMap.cs, engine/src/CodeHealth.Core/Scoring/CodeComposition.cs. 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 engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs:574— `document.FilePath is { } p && (p.Contains("/obj/", StringComparison.OrdinalIgnoreCase) || p.EndsWith(".g.cs", StringComparison.OrdinalIgnore…` appears character-identically in 2 files — engine/src/CodeHealth.Core/CodeShape/RoslynDuplicationDetector.cs, engine/src/CodeHealth.Core/Cohesion/Lcom4Calculator.cs. 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 engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs:210— `element.HasDynamicTextContent || (element.TextContent?.Contains("${", StringComparison.Ordinal) ?? false)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Markup/TaggedTemplateMarkupProducer.cs, engine/src/CodeHealth.Core/Markup/TemplateLanguageMarkupProducer.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs:669— `ext.Equals(".html", StringComparison.OrdinalIgnoreCase) || ext.Equals(".htm", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendWorkspaceWalk.cs, engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs. 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 engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs:159— `ext.Equals(".jsx", StringComparison.OrdinalIgnoreCase) || ext.Equals(".tsx", StringComparison.OrdinalIgnoreCase)` appears character-identically in 3 files — engine/src/CodeHealth.Core/Frontend/JsRedundantReDefault.cs, engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs, engine/src/CodeHealth.Dimensions.Security/Scanners/JsDeadFieldRoundTripRecheck.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:438— `f.EndsWith(".yml", StringComparison.OrdinalIgnoreCase) || f.EndsWith(".yaml", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs, engine/src/CodeHealth.Core/Readiness/CiWorkflowReader.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs:1006— `file.EndsWith(".d.ts", StringComparison.OrdinalIgnoreCase) || file.EndsWith(".d.mts", StringComparison.OrdinalIgnoreCase) || file.EndsWith("…` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendDeadCode.cs, engine/src/CodeHealth.Core/Frontend/FrontendEmittedTemplateRefs.cs. 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 engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs:418— `file.EndsWith(".vue", StringComparison.OrdinalIgnoreCase) || file.EndsWith(".svelte", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/FrontendEngine.cs, engine/src/CodeHealth.Core/Frontend/FrontendTestReachability.cs. 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 engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs:73— `fileName.StartsWith("requirements", StringComparison.OrdinalIgnoreCase) && fileName.EndsWith(".txt", StringComparison.OrdinalIgnoreCase)` appears character-identically in 2 files — engine/src/CodeHealth.Dimensions.Security/Scanners/DeepScan.cs, engine/src/CodeHealth.Reporting/Changelog/Fusion/ChangeSetBuilder.cs. 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 engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs:422— `head.StartsWith("mode: set", StringComparison.Ordinal) || head.StartsWith("mode: count", StringComparison.Ordinal) || head.StartsWith("mode:…` appears character-identically in 2 files — engine/src/CodeHealth.Core/Testing/CommittedCoverageReader.cs, engine/src/CodeHealth.Core/Testing/CoverageReportAdvice.cs. 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 engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs:859— `i + 1 < tokens.Count && tokens[i + 1].IsPunct(":")` appears character-identically in 2 files — engine/src/CodeHealth.Core/Frontend/JsScopeBindings.cs, engine/src/CodeHealth.Core/Frontend/ModuleSyntaxScanner.cs. 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.
Subsumed condition operand engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:997— `t.Contains("IdentityDbContext", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `t.Contains("IdentityDbContext", StringComparison.Ordinal)` also satisfies `t.Contains("DbContext", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Frontend/FrontendBundlerConfigRefs.cs:1234— `fileName.Equals("package-lock.json", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `fileName.Equals("package-lock.json", StringComparison.OrdinalIgnoreCase)` also satisfies `fileName.EndsWith("lock.json", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Frontend/FrontendScriptCommandRefs.cs:351— `first.Contains("bash", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `first.Contains("bash", StringComparison.Ordinal)` also satisfies `first.Contains("sh", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Frontend/NonProductionPaths.cs:234— `fn.Contains(".email.", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `fn.Contains(".email.", StringComparison.OrdinalIgnoreCase)` also satisfies `fn.Contains("email", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5016— `part.EndsWith("::before", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `part.EndsWith("::before", StringComparison.OrdinalIgnoreCase)` also satisfies `part.EndsWith(":before", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:5017— `part.EndsWith("::after", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `part.EndsWith("::after", StringComparison.OrdinalIgnoreCase)` also satisfies `part.EndsWith(":after", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:6444— `enforcementFileName.StartsWith("biome.jsonc", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `enforcementFileName.StartsWith("biome.jsonc", StringComparison.OrdinalIgnoreCase)` also satisfies `enforcementFileName.StartsWith("biome.json", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:837— `n.Contains("infrastructure")` can never decide this `||` — every value satisfying `n.Contains("infrastructure")` also satisfies `n.Contains("infra")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:171— `type.Name.EndsWith("IntegrationEvent", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `type.Name.EndsWith("IntegrationEvent", StringComparison.Ordinal)` also satisfies `type.Name.EndsWith("Event", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/DomainConventions.cs:1159— `type.Name.EndsWith("IntegrationEvent", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `type.Name.EndsWith("IntegrationEvent", StringComparison.Ordinal)` also satisfies `type.Name.EndsWith("Event", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:53— `text.Contains("IHttpClientFactory", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("IHttpClientFactory", StringComparison.Ordinal)` also satisfies `text.Contains("HttpClient", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:53— `text.Contains("AddHttpClient", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("AddHttpClient", StringComparison.Ordinal)` also satisfies `text.Contains("HttpClient", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/ModelAware/OperabilityExtrasAnalyzer.cs:262— `csproj.Contains("Nerdbank.GitVersioning", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `csproj.Contains("Nerdbank.GitVersioning", StringComparison.OrdinalIgnoreCase)` also satisfies `csproj.Contains("GitVersion", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4666— `text.Contains("IRequestHandler", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("IRequestHandler", StringComparison.Ordinal)` also satisfies `text.Contains("Handler", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4666— `text.Contains("INotificationHandler", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("INotificationHandler", StringComparison.Ordinal)` also satisfies `text.Contains("Handler", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4667— `text.Contains("BackgroundService", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("BackgroundService", StringComparison.Ordinal)` also satisfies `text.Contains("Service", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4667— `text.Contains("IHostedService", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("IHostedService", StringComparison.Ordinal)` also satisfies `text.Contains("Service", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4669— `text.Contains("IServiceCollection", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `text.Contains("IServiceCollection", StringComparison.Ordinal)` also satisfies `text.Contains("Service", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4831— `ciText.Contains("cargo-fuzz", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `ciText.Contains("cargo-fuzz", StringComparison.OrdinalIgnoreCase)` also satisfies `ciText.Contains("go-fuzz", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:4853— `ciText.Contains("codehealth analyze", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `ciText.Contains("codehealth analyze", StringComparison.OrdinalIgnoreCase)` also satisfies `ciText.Contains("codehealth ", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Toolchain/Git/LibGit2GitAccessor.cs:110— `raw.Length >= 40` can never decide this `&&` — every value satisfying `raw.Length > 40` also satisfies `raw.Length >= 40`, so the `&&` chain is already decided by the former. The expression is equivalent to the chain without it, which means it is narrower than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs:4528— `norm.EndsWith("/build.rs", StringComparison.OrdinalIgnoreCase)` can never decide this `||` — every value satisfying `norm.EndsWith("/build.rs", StringComparison.OrdinalIgnoreCase)` also satisfies `norm.EndsWith("build.rs", StringComparison.OrdinalIgnoreCase)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.PackagingIdentity.cs:220— `first.Contains("bash", StringComparison.Ordinal)` can never decide this `||` — every value satisfying `first.Contains("bash", StringComparison.Ordinal)` also satisfies `first.Contains("sh", StringComparison.Ordinal)`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
GD1 · Unfinished & placeholder code· Placeholder literal left in code · ×21
Placeholder literal left in code engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121— A placeholder string ("Is this heading or label TEXT a non-desc…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder string ("lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:229— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:329— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:339— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Core/Security/NativeSecretScanner.cs:1617— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151— A placeholder string ("change_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151— A placeholder string ("replaceme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/CommittedSecretManifestScan.cs:151— A placeholder string ("replace_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:139— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigCredentialBindingScan.cs:139— A placeholder string ("replaceme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/HostPathPersistentVolumeScan.cs:97— A placeholder string ("(?ix) <[^>]*>
| \b firstna…") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:64— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:64— A placeholder string ("change_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3733— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758— A placeholder string ("changeme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758— A placeholder string ("change_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758— A placeholder string ("replaceme") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3758— A placeholder string ("replace_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Placeholder literal left in code engine/src/CodeHealth.Dimensions.Security/Scanners/SecretNoiseFilter.cs:3759— A placeholder string ("_change_me") is still in shipped code — typical of generated boilerplate that was never filled in.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynCodeProject.cs:159— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/CodeModel/Roslyn/RoslynCodeProject.cs:162— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/Frontend/TsConfigJsChecking.cs:119— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/Markup/MarkupParser.cs:519— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:229— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:266— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:439— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/ModelAware/CsprojReferenceGraph.cs:444— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Core/Readiness/ProductionReadinessAnalyzer.cs:7745— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Dimensions.Security/Scanners/ConfigKeyNameRecheck.cs:33— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Dimensions.Security/Scanners/RenovateRuleRecheck.cs:15— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Dimensions.Security/Scanners/RenovateRuleRecheck.cs:18— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Hand-rolled JSON/XML parsing via regex engine/src/CodeHealth.Dimensions.Security/SupplyChainProvenanceAnalyzer.cs:5073— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This project already references a real parser; use it here too.
Silent fallback default on parse failure engine/src/CodeHealth.Core/Markup/MarkupParser.cs:505— `HasTitledHeadRegion` returns `false` when `headOpen.Success` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Core/ModelAware/AccessibilityAnalyzer.cs:10293— `Clamp255` falls back to `0` when `int.TryParse(n.Trim(), NumberStyles.Integer, CultureInfo.InvariantCulture, out v…` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Core/Statistics/DotnetBuildStatistician.cs:232— `ParseSummaryCount` falls back to `0` when `matches.Count > 0 && int.TryParse(matches[^1].Groups[1].Value, out var n)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Core/Testing/CoverletCoverageCollector.cs:521— `ParseDouble` falls back to `0` when `double.TryParse(v, NumberStyles.Float, CultureInfo.InvariantCulture, out var d)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Core/Testing/CoverletCoverageCollector.cs:523— `ParseInt` falls back to `0` when `int.TryParse(v, out var i)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Cli/Commands/DimensionsCommand.cs:166— `Split` falls back to `-1` when `i < id.Length && int.TryParse(id[i..], out var n)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Dimensions.Security/DependencyVulnerabilityAnalyzer.cs:453— `CollectPackages` falls back to `"?"` when `pkg.TryGetProperty("id", out var idEl)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure engine/src/CodeHealth.Dimensions.Security/Scanners/JsRegexCaptureGroupRecheck.cs:206— `LeadingIdentifier` falls back to `string.Empty` when `m.Success` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Commented-out code engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1334— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:1335— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:1117— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:2626— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:2628— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
Commented-out code engine/src/CodeHealth.Core/ModelAware/CSharpCorrectnessAnalyzer.cs:2630— A line of code has been commented out rather than removed — dead weight that rots and confuses. Delete it (version control remembers).
IC1 · Incompleteness & stubs· Placeholder data left in code · ×6
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/HeadingLabelQualityAnalyzer.cs:121— A placeholder value ("Is this heading or label TEXT a non-desc…") is still in shipped code — sample/mock data that was never replaced with the real thing.
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder value ("john doe") is still in shipped code — sample/mock data that was never replaced with the real thing.
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder value ("jane doe") is still in shipped code — sample/mock data that was never replaced with the real thing.
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder value ("john smith") is still in shipped code — sample/mock data that was never replaced with the real thing.
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder value ("foo bar") is still in shipped code — sample/mock data that was never replaced with the real thing.
Placeholder data left in code engine/src/CodeHealth.Core/ModelAware/IncompletenessAnalyzer.cs:142— A placeholder value ("lorem ipsum") is still in shipped code — sample/mock data that was never replaced with the real thing.
X31 · Test-only surface in a production module· Test-only surface in a production module · ×5
Test-only surface in a production module engine/sidecars/erlang-frontend/selftest/fixtures/src/dispatch_surface.erl:50— `dispatch_surface:helper_for_tests/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
Test-only surface in a production module engine/sidecars/erlang-frontend/selftest/fixtures/src/observed_surface.erl:40— `observed_surface:probe_test/2` is exported unconditionally and its name carries a test marker at a name-segment boundary, so the shipped module publishes a function named for the test tree. No other module in this repository calls it at any arity. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. Nothing tells the next maintainer that its only caller is a test. Wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module.
Test-only surface in a production module engine/sidecars/erlang-frontend/selftest/fixtures/src/test_surface_module.erl:32— `test_surface_module:helper_for_tests/1` is exported unconditionally, and the comment directly above the `-export` on this line says the exports below it are for testing. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. This arm read the comment, not the call graph: if the comment is right and only tests call it, wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module. If production code calls it, the comment is stale and wrapping the export would break the build — delete the comment and document the function as part of the module's API.
Test-only surface in a production module engine/sidecars/erlang-frontend/selftest/fixtures/src/test_surface_module.erl:34— `test_surface_module:test_probe/2` is exported unconditionally and its name carries a test marker at a name-segment boundary, so the shipped module publishes a function named for the test tree. No other module in this repository calls it at any arity. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. Nothing tells the next maintainer that its only caller is a test. Wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module.
Test-only surface in a production module engine/sidecars/erlang-frontend/selftest/fixtures/src/test_surface_module.erl:38— `test_surface_module:test/0` is exported unconditionally and its name IS the test marker, so the shipped module publishes a function named for the test tree. No other module in this repository calls it at any arity. Erlang has no visibility below `-export`, so this is part of the module's public contract: it cannot be changed without a compatibility argument. Nothing tells the next maintainer that its only caller is a test. Wrapping the attribute in `-ifdef(TEST). … -endif.` keeps the test's access and removes it from the shipped module.
Documentation: no installation or build instructions README.md— The README does not state how to install, build, or run the project from source. Add a short setup/install section covering dotnet tooling, global.json pinning, and the one-command build/run flow.
Documentation: no usage examples README.md— The README lacks runnable usage examples showing how to invoke Watchdog/Assay from the command line. Add a 'Run it' section with an example of starting Watchdog and Assay, referencing the e2e/run-loop.sh harness.
Documentation: no architecture or design documentation README.md— The architecture is described in one screen (00-architecture.md) but no separate architecture/design document exists for readers to refer to. Create a dedicated Architecture/Docs file covering the DDD/VSA model, shared Core, CAI reference scorer, and the two deployable apps.
Documentation: no licence statement README.md— No licence statement appears in any document. Add a LICENSE file or a one-line licensing line to each repository (or the top-level README) so readers can verify it for themselves.
Fat interface: ICodeType (69 members) engine/src/CodeHealth.Core/CodeModel/ICodeType.cs:5— `ICodeType` declares 69 members: `Kind`, `IsRecord`, `IsAbstract`, `IsSealed`, `IsStatic`, `IsValueType`, `IsGenericType`, `Name`, `Namespace`, `AssemblyName`, `ProjectName`, `Accessibility`, `TypeParameters`, `BaseType`, `HasMeaningfulBase`, `DirectInterfaces`, `AllInterfaces`, `AllInterfaceRefs`, `Special`, `Location`, `Members`, `UnionCases`, `Attributes`, `EmbeddedTypes`, `UnderlyingType`, `Language`, `FileImports`, `DerivesClause`, `RecoveryFoldCount`, `RecoveryFoldCalls`, `ConstructionCalls`, `CommandCalls`, `BypassConstructions`, `IsOrmRow`, `PrimaryCtorArity`, `OtpBehaviour`, `RestartStrategy`, `SupervisedChildren`, `ErlangEffects`, `ErlangTestOnlyExports`, and 29 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 25 project(s) overshoot their size bounds, lowering Project Cohesion to 8.4/10. The most over is `CodeHealth.Core` (239627 LoC, 943 public types across 47 namespaces). Review these for cohesion — split a project that spans unrelated responsibilities.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Rotate the exposed credentials — git history can't be un-committed — Some of these secrets are in git HISTORY: deleting the file does not remove them (the commit persists on every clone, fork and backup). The remediation is to ROTATE each historically-exposed credential and treat it as compromised — not to delete the file. Rewriting history is disruptive and unreliable across existing forks. (Working-tree-only secrets — no commit — can instead be removed from the file and moved to a secret store.) If flagged rows sit in content that is not this repository's own authored code — tool-emitted artifacts, recorded scanner output, wholesale-vendored third-party files — declare that provenance in .gitattributes (`path/** linguist-generated` or `linguist-vendored`): this scanner honors the repository's own declarations and stops counting such content, history-anchored rows included, on the next scan. The declaration is a reviewable statement about provenance, not a suppression — never use it on files that carry your own credentials.
No dependency advisory monitoring — Nothing in this repository re-checks its pinned dependencies when an advisory is published: no Dependabot or Renovate configuration (`.github/dependabot.yml`, `renovate.json`), no advisory scanner invoked from CI and no committed scanner configuration (`deny.toml`, `.cargo/audit.toml`, `osv-scanner.toml`, `.snyk`). The manifests present — `cargo` (Cargo.toml), `npm` (package.json), `gomod` (go.mod), `maven` (pom.xml), `composer` (composer.json), `mix` (mix.exs), `pub` (pubspec.yaml), `swift` (Package.swift), `nuget` (*.csproj) — pin versions that advisories are published against on the advisory database's clock, not this repository's, so every advisory that lands against a pinned version stays unseen until someone points a scanner at the tree (any already published are reported under D30, one row per package — this row names the control whose absence lets them accumulate). GitHub's Dependabot alerts, if switched on in the repository settings, notify but leave nothing in the tree; a committed configuration is what makes the control reviewable and carries it to a fork or mirror. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per manifest listed (or a `renovate.json`) so each advisory arrives as a pull request against the affected lockfile; or wire the ecosystem's own advisory scanner into CI on a `schedule:` trigger — cargo: `cargo audit` (rustsec/audit-check) or `cargo deny check advisories` with a `deny.toml`; npm: `npm audit` / `pnpm audit` / `yarn npm audit`; gomod: `govulncheck ./...`; maven: `osv-scanner` or OWASP `dependency-check`; composer: `composer audit`; mix: `mix hex.audit` / `mix deps.audit`; pub: `osv-scanner`; swift: `osv-scanner`; nuget: `dotnet list package --vulnerable` failing on output, or promote the SDK's audit warnings to errors (`<WarningsAsErrors>NU1901;NU1902;NU1903;NU1904</WarningsAsErrors>`).
IL efficiency: 615 authored method(s) exceed the IL budget engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5494— 615 of 22384 first-party methods compile to oversized IL bodies (> 250 instructions); worst: CodeHealth.Core.Compliance.ComplianceSecurityAnalyzer.S1 @ engine/src/CodeHealth.Core/Compliance/ComplianceSecurityAnalyzer.cs:5494, 2456 IL instructions; that pulled this dimension to 9.5/10. These bodies are far past the JIT's inline budget, so splitting them does not make them inlinable — what moves the number is emitting less: collapsing LINQ chains and closures on hot paths, and interpolation built eagerly where it is only sometimes used.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
DM9 · Scattered domain decisions· Rule about [Failed, Passed] decided in 2 places · ×1
Rule about [Failed, Passed] decided in 2 places — (int Passed, int Failed)'s [Failed, Passed] are judged in CodeHealth.Core.Testing.DotnetTestReliabilityCollector, CodeHealth.Core.Testing.NodeTestReliabilityCollector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [End, Start] decided in 3 places · ×1
Rule about [End, Start] decided in 3 places — (int Start, int End)'s [End, Start] are judged in CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RoslynDuplicationDetector.CoalescedRegion, CodeHealth.Core.ExplicitDebt.RazorGeneratedDocumentSynthesizer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Setter, SetterAccessibility] decided in 8 places · ×1
Rule about [Setter, SetterAccessibility] decided in 8 places — CodeHealth.Core.CodeModel.IProperty's [Setter, SetterAccessibility] are judged in CodeHealth.Core.ModelAware.DartDomainConventions, CodeHealth.Core.ModelAware.DomainConventions, CodeHealth.Core.ModelAware.DomainModelAnalyzer, CodeHealth.Core.ModelAware.EventSourcingAnalyzer, CodeHealth.Core.ModelAware.KotlinDomainConventions, CodeHealth.Core.ModelAware.PythonDomainConventions, CodeHealth.Core.ModelAware.SwiftDomainConventions, CodeHealth.Core.ModelAware.SymbolHelpers — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Class, Record] decided in 2 places · ×1
Rule about [Class, Record] decided in 2 places — CodeHealth.Core.CodeModel.TypeKind's [Class, Record] are judged in CodeHealth.Core.ModelAware.DomainModelAnalyzer, CodeHealth.Core.ModelAware.SwiftDomainConventions — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [EndLine, StartLine] decided in 4 places · ×1
Rule about [EndLine, StartLine] decided in 4 places — CodeHealth.Core.CodeShape.CloneMemberExtent's [EndLine, StartLine] are judged in CodeHealth.Core.CodeShape.ChainedCorrespondence, CodeHealth.Core.CodeShape.ChainedFamilyRollup, CodeHealth.Core.CodeShape.MemberFamilyRollup, CodeHealth.Core.CodeShape.MemberPairRollup — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [EndLine, StartLine] decided in 3 places · ×1
Rule about [EndLine, StartLine] decided in 3 places — CodeHealth.Core.CodeShape.DuplicationLocation's [EndLine, StartLine] are judged in CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RoslynDuplicationDetector.CoalescedRegion, CodeHealth.Core.Frontend.JsDuplicationDetector — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [BodyClose, BodyOpen] decided in 2 places · ×1
Rule about [BodyClose, BodyOpen] decided in 2 places — CodeHealth.Core.Frontend.JsConstantOnlyField.ClassBody's [BodyClose, BodyOpen] are judged in CodeHealth.Core.Frontend.JsConstantOnlyField, CodeHealth.Core.Frontend.JsConstantOnlyField.PropertyWrite — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [BodyTokenEnd, BodyTokenStart] decided in 2 places · ×1
Rule about [BodyTokenEnd, BodyTokenStart] decided in 2 places — CodeHealth.Core.Frontend.JsFunctionUnit's [BodyTokenEnd, BodyTokenStart] are judged in CodeHealth.Core.Complexity.FirstPartyJsComplexity, CodeHealth.Core.Frontend.JsComplexity — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Kind, Text] decided in 4 places · ×1
Rule about [Kind, Text] decided in 4 places — CodeHealth.Core.Frontend.JsToken's [Kind, Text] are judged in CodeHealth.Core.Frontend.FrontendTestReachability, CodeHealth.Core.Frontend.JsConstantOnlyField, CodeHealth.Core.Frontend.JsDuplicationDetector, CodeHealth.Core.Frontend.JsScopeBindings — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Identifier, Keyword] decided in 4 places · ×1
Rule about [Identifier, Keyword] decided in 4 places — CodeHealth.Core.Frontend.JsTokenKind's [Identifier, Keyword] are judged in CodeHealth.Core.Frontend.ExportUsageSolver, CodeHealth.Core.Frontend.JsScopeBindings, CodeHealth.Core.Frontend.JsToken, CodeHealth.Core.Frontend.ModuleSyntaxScanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [StringLiteral, TemplateString] decided in 2 places · ×1
Rule about [StringLiteral, TemplateString] decided in 2 places — CodeHealth.Core.Frontend.JsTokenKind's [StringLiteral, TemplateString] are judged in CodeHealth.Core.Frontend.FrontendEngine, CodeHealth.Core.Frontend.ModuleSyntaxScanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Identifier, Punctuator] decided in 3 places · ×1
Rule about [Identifier, Punctuator] decided in 3 places — CodeHealth.Core.Frontend.JsTokenKind's [Identifier, Punctuator] are judged in CodeHealth.Core.Frontend.JsDuplicationDetector, CodeHealth.Core.Markup.JsxMarkupProducer, CodeHealth.Core.Markup.JsxMarkupProducer.Walker — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [SpecialType, TypeKind] decided in 2 places · ×1
Rule about [SpecialType, TypeKind] decided in 2 places — Microsoft.CodeAnalysis.ITypeSymbol's [SpecialType, TypeKind] are judged in CodeHealth.Core.ModelAware.CSharpCorrectnessAnalyzer, CodeHealth.Core.ModelAware.JsInteropContractAnalyzer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Count, this[]] decided in 2 places · ×1
Rule about [Count, this[]] decided in 2 places — System.Collections.Generic.List<int>'s [Count, this[]] are judged in CodeHealth.Core.Frontend.JsLexer, CodeHealth.Core.Frontend.JsLexer.Scanner — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Length, this[]] decided in 3 places · ×1
Rule about [Length, this[]] decided in 3 places — System.ReadOnlySpan<char>'s [Length, this[]] are judged in CodeHealth.Core.CodeShape.NeutralFileLengthScanner, CodeHealth.Core.ExplicitDebt.SourceCommentTaskScanner, CodeHealth.Core.Scoring.DiskSourceFiles — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Object, String] decided in 11 places · ×1
Rule about [Object, String] decided in 11 places — System.Text.Json.JsonValueKind's [Object, String] are judged in CodeHealth.Core.Dependencies.NpmRegistryClient, CodeHealth.Core.Dependencies.OsvAdvisoryClient, CodeHealth.Core.Dependencies.RubyGemsRegistryClient, CodeHealth.Core.Dependencies.UnityRegistryClient, CodeHealth.Core.Frontend.FrontendManifestEntryPoints, CodeHealth.Core.Frontend.FrontendManifestParsing, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.Readiness.ProductionReadinessAnalyzer, CodeHealth.Core.Testing.CommittedCoverageReader, CodeHealth.Core.Testing.NodeTestSuiteProbe, CodeHealth.Core.Testing.NodeWorkspaceSiblingBuilder — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Array, Object] decided in 6 places · ×1
Rule about [Array, Object] decided in 6 places — System.Text.Json.JsonValueKind's [Array, Object] are judged in CodeHealth.Core.Frontend.FrontendManifestEntryPoints, CodeHealth.Core.Frontend.FrontendManifestParsing, CodeHealth.Core.Frontend.FrontendWorkspaceLoader, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.Security.SyftSbomNormalizer, CodeHealth.Core.Testing.CommittedCoverageReader — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Length, this[]] decided in 4 places · ×1
Rule about [Length, this[]] decided in 4 places — System.Text.StringBuilder's [Length, this[]] are judged in CodeHealth.Core.Markup.TaggedTemplateMarkupProducer, CodeHealth.Core.Markup.TaggedTemplateMarkupProducer.Template, CodeHealth.Core.Markup.TemplMarkupProducer, CodeHealth.Core.Markup.TemplateLanguageMarkupProducer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Length, this[]] decided in 81 places · ×1
Rule about [Length, this[]] decided in 81 places — string's [Length, this[]] are judged in CodeHealth.Core.ApiSurface.ApiSurfaceExtractor, CodeHealth.Core.ApiSurface.CSharpSourceScanner, CodeHealth.Core.ApiSurface.RouteTemplateNormalizer, CodeHealth.Core.Classification.RustInlineTestModule, CodeHealth.Core.CodeShape.GoRawStringRegions, CodeHealth.Core.CodeShape.NeutralFileLengthScanner, CodeHealth.Core.CodeShape.NeutralMethodLengthScanner, CodeHealth.Core.CodeShape.PolyglotConditionScanner, CodeHealth.Core.CodeShape.RazorCodeVirtualizer, CodeHealth.Core.CodeShape.RoslynDuplicationDetector, CodeHealth.Core.CodeShape.RustInlineTestRegions, CodeHealth.Core.CodeShape.RustInlineTestRegions.LineLexer, CodeHealth.Core.Cohesion.Lcom4Calculator, CodeHealth.Core.Compliance.PiiDataMapAnalyzer, CodeHealth.Core.Dart.DartDeadLibraryField, CodeHealth.Core.Dart.DartRepositoryIdentifiers, CodeHealth.Core.Dependencies.MavenVersion, CodeHealth.Core.Dependencies.NpmManifestHygiene, CodeHealth.Core.Dependencies.PnpmLockfileReader, CodeHealth.Core.Dependencies.SwiftPackageHygiene, CodeHealth.Core.Discovery.FrontendAnalyzer, CodeHealth.Core.Discovery.FrontendSourcePresence, CodeHealth.Core.Discovery.UnityProjectPresence, CodeHealth.Core.ExplicitDebt.AttributeConsumptionScanner, CodeHealth.Core.ExplicitDebt.RazorCodeBlockProjection, CodeHealth.Core.ExplicitDebt.RazorGeneratedDocumentSynthesizer, CodeHealth.Core.ExplicitDebt.ReflectiveDiscoveryScanner, CodeHealth.Core.ExplicitDebt.RoslynDeadCodeDetector, CodeHealth.Core.ExplicitDebt.RoslynExplicitDebtCollector, CodeHealth.Core.FileQuality.GeneratedCodePolicy, CodeHealth.Core.Frontend.EntryPointCatalog, CodeHealth.Core.Frontend.FrontendBoundaries, CodeHealth.Core.Frontend.FrontendDeadCode, CodeHealth.Core.Frontend.FrontendDeclaredPackageRefs, CodeHealth.Core.Frontend.FrontendDependencyHygiene, CodeHealth.Core.Frontend.FrontendEngine, CodeHealth.Core.Frontend.FrontendEngineDimensions, CodeHealth.Core.Frontend.FrontendMarkupRefs, CodeHealth.Core.Frontend.FrontendPathLiteralRefs, CodeHealth.Core.Frontend.FrontendSpecifierScanning, CodeHealth.Core.Frontend.FrontendTestReachability, CodeHealth.Core.Frontend.FrontendTestSuiteMasking, CodeHealth.Core.Frontend.JsLexer, CodeHealth.Core.Frontend.JsLexer.Scanner, CodeHealth.Core.Frontend.JsScopeBindings, CodeHealth.Core.Frontend.JsStringConstants, CodeHealth.Core.Frontend.MinifiedJsHeuristics, CodeHealth.Core.Frontend.ModuleGlobPattern, CodeHealth.Core.Frontend.ModuleResolver, CodeHealth.Core.Frontend.ModuleSyntaxScanner, CodeHealth.Core.Frontend.NonProductionPaths, CodeHealth.Core.Frontend.NonProductionTreeReadmission, CodeHealth.Core.Frontend.PlatformSubstitutionTable, CodeHealth.Core.Frontend.TsConfigFacts, CodeHealth.Core.Frontend.TsConfigGlob, CodeHealth.Core.Markup.AstroMarkupProducer, CodeHealth.Core.Markup.IndentedMarkupProducer, CodeHealth.Core.Markup.MarkupParser, CodeHealth.Core.Markup.TemplateLanguageMarkupProducer, CodeHealth.Core.Maturity.MaturityAnalyzer, CodeHealth.Core.ModelAware.AccessibilityAnalyzer, CodeHealth.Core.ModelAware.DomainConventions, CodeHealth.Core.ModelAware.GoDomainConventions, CodeHealth.Core.ModelAware.HeadingLabelQualityAnalyzer, CodeHealth.Core.ModelAware.IncompletenessAnalyzer, CodeHealth.Core.ModelAware.LogicDefectAnalyzer, CodeHealth.Core.ModelAware.PerformanceAnalyzer, CodeHealth.Core.ModelAware.RubyDomainConventions, CodeHealth.Core.ModelAware.SupplyChainHygieneAnalyzer, CodeHealth.Core.Readiness.CiWorkflowReader, CodeHealth.Core.Readiness.PipelineVersionOutputScan, CodeHealth.Core.Readiness.VacuousFormatGate, CodeHealth.Core.Scoring.CiGateDetection, CodeHealth.Core.Scoring.CompileRemovedPaths, CodeHealth.Core.Security.NativeSecretScanner, CodeHealth.Core.Testing.CompileExcludedTestFiles, CodeHealth.Core.Testing.GoTestCensus, CodeHealth.Core.Testing.JsTestCensus, CodeHealth.Core.Testing.JsTestQualityCensus, CodeHealth.Core.Testing.PythonTestCensus, CodeHealth.Core.Testing.RustTestCensus — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [AchievedRung, CeilingRung] decided in 2 places · ×1
Rule about [AchievedRung, CeilingRung] decided in 2 places — CodeHealth.Core.Dimensions.DimensionResult's [AchievedRung, CeilingRung] are judged in CodeHealth.Reporting.Recommendations.RuleRecommendationEngine, CodeHealth.Reporting.Scorecard.ScorecardJsonRenderer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions· Rule about [Count, this[]] decided in 3 places · ×1
Rule about [Count, this[]] decided in 3 places — System.Collections.Generic.List<string>'s [Count, this[]] are judged in CodeHealth.Dimensions.Security.Scanners.MutableGitCloneScan, CodeHealth.Dimensions.Security.Scanners.UnpinnedToolchainInstallScan, CodeHealth.Dimensions.Security.SupplyChainProvenanceAnalyzer — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
P12 · CI test-gate honesty· Sleep-based test synchronization · ×1
Sleep-based test synchronization — 85 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
Logging is not universal — Only 17/20 service-like projects use logging (pure contract/DTO projects are excluded — they have nothing to log). Of those 20, 2 ship a process this repository operates; the rest are libraries their consumer hosts, where the logging decision belongs to the host.
Unused export 'NAME_ONLY' engine/sidecars/tsjs-frontend/constants.mjs:128— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'ORM_DECORATORS' · ×1
Unused export 'ORM_DECORATORS' engine/sidecars/tsjs-frontend/constants.mjs:132— Nothing imports this binding — it is safe to review for removal.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 346/379 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Null-forgiving operator (`!`) suppressions reduce the NRT score — ~0.3 `!` suppressions per 1k syntax nodes — 413 suppression(s) across the 1501958 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
D8 · Code Coverage· Coverage read from a committed report · ×1
Coverage read from a committed report — Line coverage 78.5% — read from a committed cobertura report (tools/train/backlog-sessions/01a092f6-f3c2-754f-b7f2-bd802ec4404a/specimen-cobertura-coverage.xml); the in-image collector couldn't run the suite (commonly external-service dependencies). A real measurement, but from a committed artifact rather than a fresh in-image run.
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.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 713 file(s) — `engine/sidecars/java-spoon/src/main/java/dev/canine/codehealth/java/Main.java`, `engine/src/CodeHealth.Cli/Commands/AnalyzeCommand.cs`, `engine/src/CodeHealth.Cli/Commands/DimensionsCommand.cs`, `engine/src/CodeHealth.Cli/Commands/RecordingToolRunner.cs`, `engine/src/CodeHealth.Cli/Commands/SpecCommand.cs`, … (+708 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
0
—
Run 01a0a533-4f9c-7b7c-9fe0-752186667f83 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Appendix C — Personal-data map
Every field, property and record parameter whose name is conventional personal data — 7 field(s) across 1 category, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by NAME, from the C# syntax tree, with a deliberately specific identifier classifier — the same one the C1–C5 compliance cards use to decide whether personal data is present, so CardDefinition or FileName don't trip. Two caveats stated rather than glossed: those cards additionally require corroboration (a persistence/account signal, or two distinct PII categories) that this inventory deliberately does not, so it lists more than they gate on; and D32 Data Compliance shares nothing with it — that dimension is a separate semgrep ruleset for personal data leaking into logs, URLs and browser storage, and a clean D32 result says nothing about this list. Informational — it feeds no score.
Issues: 73 · Warnings: 3265 · Recommendations: 145 · Info: 40 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 15-09-2026 @ 13:13 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.