Public report — azul, published 29 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_e377ff841c9b49bd877037d20985622f
Filed 29 September 2026, 19:57 UTC
Public
Very large · 1,083,804 LoC · 11 projects · rebuild ~7.6 person-years · weakest lens: Code Health (42%)
Findings by grade
32 critical4919 serious35 minor5 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 19:29 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 ▸
4962findings with an exact file:lineof 4986 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
72/134dimensions across the health lenses1083804 LoC · 11 projects — wide & deep
The platform is a massive, high-value asset with a solid architectural foundation, but it carries significant operational risk due to poor code maintainability. With a health score of 56%, the system is workable but fragile under pressure. Rebuilding this 1.1 million line codebase would cost approximately €1.1 million and take nearly eight person-years, representing a substantial investment that is currently eroding by technical debt. The primary danger is not structural failure, but the slow, compounding cost of complexity that slows every feature delivery.
The most critical issue is code health, which sits at a weak 42%. This low score acts as a hidden tax on every change, adding an estimated 4–8% overhead to development time. For a team modifying millions of lines annually, this inefficiency translates to hundreds of lost engineer-days each year. The code is dense and complex, making it difficult for new engineers to contribute safely and increasing the likelihood of defects. This is the area where remediation offers the highest return, as fixing it pays for itself within months by restoring velocity.
A secondary concern is the frontend’s lack of type safety. The entire frontend is written in untyped JavaScript, which means errors are only caught at runtime rather than during development. This creates a reliability gap and increases the cost of changes. Adopting TypeScript is the highest-leverage move available; it requires minimal upfront effort but provides immediate protection against regressions and improves developer confidence. This is an adoption task, not a cleanup, making it a quick win for stability.
Despite these risks, the system’s architecture is excellent at 98%, meaning changes do not ripple unpredictably through the system. This strong foundation allows the team to focus on code quality without fearing systemic collapse. However, confidence in the assessment is high, though some areas like domain modeling and performance were not measured. To protect the business, leadership should prioritize breaking down complex functions and introducing TypeScript to the frontend. These actions address the biggest risks to delivery speed and cost with the least effort, securing the asset’s long-term value.
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.
Raise Code Health 42 → 70 (the Healthy floor) ⇒ headline 56 → ~67.
Code composition — where the lines go
Plumbing 0%Tests 100%
New since the last scan (100+)
742 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 — €370,000–€1,900,000
0.8× (at 56% quality) — the last 20% of quality is most of the work
Size & shape
Very large · effort split not classified for 1,083,767 line(s) outside the .NET model (the tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~7.6 person-years of build effort (about ~€1,100,000 to rebuild). Its weakest lens is Code Health at 42% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Low (×0.9) — library/CLI × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source. 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
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
Value concentrated against a weak lens · High · Value at risk
This is a Very large asset (~7.6 person-years to rebuild), and its weakest lens is Code Health at 42%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~7.6 person-years rebuild (1,083,804 LoC) · weakest lens: Code Health 42%
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 473.6–2841.9 engineer-days every year, paid as drag on the ~5,365,634 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 4–8% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 1,323,033 line(s) changed over a 90-day window ⇒ ~5,365,634/year · D1/D2/D4/D6 code quality: averaging 6.6/10 ⇒ a 4–8% 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: Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.6/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 4–8% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.6/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
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.)
1034 modules, 4445 dependencies. 8 dependency cycles across 328 modules, marked above the diagonal.
Showing the 40 most-connected modules; 994 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.
azul_doc.codegen.v2.generator uses azul_doc.codegen.v2.config. Changing azul_doc.codegen.v2.config can break azul_doc.codegen.v2.generator, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
13→8 azul_layout.font_traits.stub depends on azul_core.task✕
Type pairs
1 distinct (type in azul_layout.font_traits.stub → type in azul_core.task) reference.
webrender_api.display_item uses azul_css.props.basic.color. Changing azul_css.props.basic.color can break webrender_api.display_item, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
16→28 webrender_api.display_item depends on azul_css.props.basic.geometrycycle✕
Type pairs
33 distinct (type in webrender_api.display_item → type in azul_css.props.basic.geometry) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
webrender_api.display_item uses azul_css.props.basic.geometry. Changing azul_css.props.basic.geometry can break webrender_api.display_item, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
16→30 webrender_api.display_item depends on azul_core.resourcescycle✕
Type pairs
6 distinct (type in webrender_api.display_item → type in azul_core.resources) references.
webrender_api.display_item uses azul_layout.solver3.display_list. Changing azul_layout.solver3.display_list can break webrender_api.display_item, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
17→2 azul_css.dynamic_selector depends on azul_css.corety✕
Type pairs
3 distinct (type in azul_css.dynamic_selector → type in azul_css.corety) references.
webrender.internal_types uses azul_css.props.basic.geometry. Changing azul_css.props.basic.geometry can break webrender.internal_types, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
20→30 webrender.internal_types depends on azul_core.resourcescycle✕
Type pairs
5 distinct (type in webrender.internal_types → type in azul_core.resources) references.
swgl_shaders.shaders.brush_blend uses webrender.render_task. Changing webrender.render_task can break swgl_shaders.shaders.brush_blend, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
26→23 swgl_shaders.shaders.brush_blend depends on webrender.gpu_types✕
Type pairs
1 distinct (type in swgl_shaders.shaders.brush_blend → type in webrender.gpu_types) reference.
azul_layout.text3.cache uses azul_css.props.basic.color. Changing azul_css.props.basic.color can break azul_layout.text3.cache, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→13 azul_layout.text3.cache depends on azul_layout.font_traits.stub✕
Type pairs
57 distinct (type in azul_layout.text3.cache → type in azul_layout.font_traits.stub) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
azul_layout.solver3.display_list uses azul_css.props.basic.pixel. Changing azul_css.props.basic.pixel can break azul_layout.solver3.display_list, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→11 azul_layout.solver3.display_list depends on azul_css.props.basic.color✕
Type pairs
4 distinct (type in azul_layout.solver3.display_list → type in azul_css.props.basic.color) references.
azul_layout.solver3.display_list uses azul_css.props.basic.color. Changing azul_css.props.basic.color can break azul_layout.solver3.display_list, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→13 azul_layout.solver3.display_list depends on azul_layout.font_traits.stub✕
Type pairs
4 distinct (type in azul_layout.solver3.display_list → type in azul_layout.font_traits.stub) references.
azul_layout.solver3.display_list uses azul_layout.font_traits.stub. Changing azul_layout.font_traits.stub can break azul_layout.solver3.display_list, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→16 azul_layout.solver3.display_list depends on webrender_api.display_item✕
Type pairs
1 distinct (type in azul_layout.solver3.display_list → type in webrender_api.display_item) reference.
azul_layout.solver3.display_list uses webrender_api.display_item. Changing webrender_api.display_item can break azul_layout.solver3.display_list, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→19 azul_layout.solver3.display_list depends on azul_css.css✕
Type pairs
3 distinct (type in azul_layout.solver3.display_list → type in azul_css.css) references.
azul_layout.solver3.display_list uses azul_layout.text3.cache. Changing azul_layout.text3.cache can break azul_layout.solver3.display_list, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→33 azul_layout.solver3.display_list depends on azul_core.geomcycle✕
Type pairs
19 distinct (type in azul_layout.solver3.display_list → type in azul_core.geom) references.
webrender.scene_building uses azul_css.props.basic.color. Changing azul_css.props.basic.color can break webrender.scene_building, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→16 webrender.scene_building depends on webrender_api.display_item✕
Type pairs
44 distinct (type in webrender.scene_building → type in webrender_api.display_item) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
webrender.scene_building uses azul_css.props.basic.geometry. Changing azul_css.props.basic.geometry can break webrender.scene_building, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→30 webrender.scene_building depends on azul_core.resources✕
Type pairs
4 distinct (type in webrender.scene_building → type in azul_core.resources) references.
webrender.scene_building uses azul_layout.solver3.display_list. Changing azul_layout.solver3.display_list can break webrender.scene_building, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→1 azul_core.events depends on azul_core.id.node_id✕
Type pairs
2 distinct (type in azul_core.events → type in azul_core.id.node_id) references.
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A03:2021 — Injection
33
High / Critical
A05:2021 — Security Misconfiguration
16
High / Critical
A06:2021 — Vulnerable & Outdated Components
9
High / Critical
Roadmap
Begin by introducing type safety to the frontend through a build-time check or incremental conversion of high-traffic modules. Next, reduce cyclomatic complexity by refactoring branch-heavy functions and split oversized files into smaller, focused modules based on their existing responsibilities. Address code duplication by extracting shared logic or types where appropriate, and finally, remove dead files and unused exports to eliminate unnecessary maintenance overhead.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
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.
The release job declares an environment, but its protection rules are not visible from the repository — confirm required reviewers are attached, or publish as a draft release so a bad build can be stopped before users can download it.
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 — 32
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 — 4919
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 — 35
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 5
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. 68 of 72 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 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 — 72 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, 4962 of 4986 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.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs) and this repository declares a Cargo test suite (repository root, 671 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Dependency Hygiene ran out of its 5-minute budget before it had finished, so what it reports here is a floor rather than a complete count. The rows above are real and stand; what is not known is how many more there are. This is a limit of the analysis run, not a finding about this repository.
D14 License Compliance — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. License Compliance couldn't be assessed within its 15-minute budget on a solution this large — not included in this run.
D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For core/src/xml.rs, css/src/props/style/background.rs, dll/src/web/mod.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D16 Bus Factor — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. Single-maintainer repository — bus factor is not applicable (32 contributor(s) across 9829 commit(s) sampled, automation and bot accounts excluded). One of them holds 99% of the history; the other 31 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.
D17 Explicit Debt — 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 0 deducted marker(s) and the 0.0/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (1,057,752 lines, 98% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 415 task marker(s) (TODO/FIXME/HACK/XXX) across 110 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D39 IL Efficiency — 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. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D22, 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.
693 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was PlatformWindow::apply_user_change at 315. A further 136 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 azul_core::ua_css::get_ua_property at 213 — they are counted neither in the figure above nor in this dimension's score. 32 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: core/src/ua_css.rs (azul_core::ua_css::get_ua_property at 213), css/src/css.rs (NodeTypeTag::from_str at 185), css/src/codegen/rust.rs (azul_css::codegen::rust::format_node_type at 184), core/src/window.rs (VirtualKeyCode::from_u32 at 164), dll/src/web/html_render.rs (azul_dll::web::html_render::node_type_to_html_tag at 144), and 27 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.
+ 141 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 177 azul_doc finding(s) in Cyclomatic Complexity — start with mod.rs (34), wrappers.rs (30), types.rs (21). — One of this dimension's main actionable groups (177 warning-level).
Resolve the 102 azul_layout finding(s) in Cyclomatic Complexity — start with cache.rs (14), fc.rs (12), raster.rs (8). — One of this dimension's main actionable groups (102 warning-level).
Resolve the 78 azul_dll finding(s) in Cyclomatic Complexity — start with mod.rs (12), transpiler_remill.rs (11), symbol_table.rs (6). — One of this dimension's main actionable groups (78 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.
+ 219 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 353 azul_doc finding(s) in Cognitive Complexity — start with types.rs (61), wrappers.rs (45), mod.rs (44). — One of this dimension's main actionable groups (353 warning-level).
Resolve the 203 azul_layout finding(s) in Cognitive Complexity — start with getters.rs (24), cache.rs (20), fc.rs (19). — One of this dimension's main actionable groups (203 warning-level).
Resolve the 152 azul_dll finding(s) in Cognitive Complexity — start with transpiler_remill.rs (26), mod.rs (23), system_style.rs (15). — One of this dimension's main actionable groups (152 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.8 / 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 210 FunctionTooLong finding(s) in God Classes — start with mod.rs (26), fc.rs (14), cache.rs (10). — One of this dimension's main actionable groups (210 warning-level).
Resolve the 194 FileTooLong finding(s) in God Classes — start with mod.rs (18), events.rs (4), window.rs (2). — One of this dimension's main actionable groups (194 warning-level).
Resolve the 136 MethodTooLong finding(s) in God Classes — start with mod.rs (34), picture.rs (11), property.rs (7). — One of this dimension's main actionable groups (136 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.
1750 duplicated block group(s) detected. A further 116 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 1866 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.
+ 409 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 100 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with mod.rs (12), wrappers.rs (8), types.rs (8). — One of this dimension's main actionable groups (100 warning-level).
Resolve the 98 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with mod.rs (17), wrappers.rs (12), types.rs (8). — One of this dimension's main actionable groups (98 warning-level).
Resolve the 95 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with wrappers.rs (15), mod.rs (11), types.rs (10). — One of this dimension's main actionable groups (95 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling6.9 / 10Adequate✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
11 production modules (Cargo), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 3 module(s) off the main sequence.
Off the main sequence: webrender_build · ×3
Unstable project webrender
What to do
Resolve the 3 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 1 Unstable project webrender finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 25 Low cohesion finding(s) in Cohesion (LCOM4) — start with callbacks.rs (3), mod.rs (3), prop_cache.rs. — One of this dimension's main actionable groups (25 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution9.9 / 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.
17216 test methods: 14953 unit, 2181 integration, 0 BDD, 82 e2e. The Rust suite contributes 17216 `#[test]` function(s) across 671 file(s) declaring at least one; its unit/integration split is Cargo's own — 226 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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: dll/src/desktop/shell2/common/event.rs (221×315=69615); layout/src/window.rs (338×89=30082); dll/src/desktop/shell2/windows/mod.rs (106×205=21730) Repeated repair below the complexity floor: core/src/task.rs (16 of 28 changes were fixes); core/src/refany.rs (12 of 22 changes were fixes); examples/go/main.go (12 of 22 changes were fixes)
Resolve the 202 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (23), wrappers.rs (15), types.rs (9). — One of this dimension's main actionable groups (202 warning-level).
Resolve the 57 Repeated repair finding(s) in Churn × Complexity Hotspots — start with functions.rs (19), wrappers.rs (4), android.rs (3). — One of this dimension's main actionable groups (57 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.
0 deducted debt markers + 0 dead symbols across 37 LoC in the .NET projects (0.0/KLoC) → score 10.0. Measured on the .NET source only: .rs (98% of production source) was not read, and carries at least 415 uncounted task marker(s) in 110 file(s).
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.
The repository's root README (AZUL - Desktop GUI framework) is excellent: it states what the project does (a free functional reactive GUI framework for Rust/C++ built on WebRender and a CSS/HTML document model), links to the website, releases page, user guide, API docs, and current status with a strong warning that Azul is not usable yet. It also documents building from source and a multitool azul-doc (codegen + autofix + reftest pipeline) for the CSS layout engine, plus a detailed README of the doc/ directory (azul-doc), examples/lisp/README, packaging/pypi/README, scripts/e2e-web/README, telemetry-grafana/README, and layout/tests/fonts/README. The architecture/design docs are also present but not shown in this summary. All visible documents are complete and well-structured. (16 of 25 sampled documents could not be assessed: 1 of 2 evaluation groups failed.)
Resolve the 1 Low XML-doc coverage finding(s) in Documentation Quality — start with Hello.csproj. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 11 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyWeak◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
4 API inconsistencies across a 400-member sample of 4576 exposed types.
Redundant naming for mutation vs immutable update. 'assign' implies mutation (void/return unit), while 'assigned' implies returning a new instance. However, both take a 'patch' and the return type of 'assign' is not explicitly shown as void but 'assigned' returns Self. In builder patterns, usually one method mutates and returns Self, or one returns a new instance. Having two methods with such similar names ('assign' vs 'assigned') for what is likely the same logical operation (merging patch data) is confusing.
Conflicting naming for Option unwrapping. 'into_option' typically implies consuming the wrapper to get the inner value (or the standard Option<T>). 'as_option' usually implies borrowing. However, both signatures return `AccessibilityAction` (owned), not `&AccessibilityAction`. This suggests 'as_option' is misnamed or 'into_option' is misnamed. Standard Rust convention is 'into_inner' or 'unwrap' for owned, and 'as_ref'/'as_mut' for borrowed. Using 'as_option' for an owned return is non-standard and confusing.
Ambiguous naming for single-item construction. 'from_vec' suggests taking a collection (Vec), but the argument is a single `AccessibilityAction`. 'from_item' is clearer. Having both suggests 'from_vec' might be a typo or legacy name, or it takes a Vec in a different overload not shown, but the signature shows a single item. This creates confusion about whether to pass a single item or a collection.
Inconsistent error handling for index access. 'get' returns the value directly (likely panicking on out-of-bounds), while 'c_get' returns an Option. This is a common pattern in C-FFI wrappers, but the naming 'c_get' is obscure. It should likely be 'get_safe' or 'try_get' to match standard Rust conventions, or 'get' should return an Option and 'get_unchecked' should return the value.
What to do
Resolve the 1 Redundant naming for mutation vs immutable update. 'assign' implies… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Conflicting naming for Option unwrapping. 'into_option' typically… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous naming for single-item construction. 'from_vec' suggests… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: Secret scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
33 finding(s): 0 critical, 24 high, 9 medium, 0 low. 5 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 28 file(s) — `core/src/dom.rs` (line 3867), `core/src/host_invoker.rs` (line 232, line 1029), `core/src/host_invoker_test.rs` (line 254), `core/src/refany.rs` (line 837, line 1296), `core/src/refany_test.rs` (line 388, line 406, line 449, …), … (+23 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 4 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (11). — One of this dimension's main actionable groups (11 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
No action in Static Analysis (SAST) — all 5 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (5 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 1 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 6 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 5 High IaC finding(s) in IaC & Container Security — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 10 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (10). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 1 Low IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 recommendation-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 691 of the 733 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 2 Change coupling finding(s) in Change Coupling — start with prop_cache.rs, tabs.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 7 platform declaration(s) and 4 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
End-of-life runtime: Rust 1.91
What to do
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
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 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.
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.
`AsyncScreenshotGrabber.get_screenshot` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — webrender/core/src/screen_capture.rs:110
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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 & versioning6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
3967/5559 types (71%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
What to do
Keep implementation types off the public surface (Rust: `pub(crate)`, or keep the module private) so internals can change without breaking consumers.
Do you agree with this assessment?
P2 · Observability8.7 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `doc/aztest`, `layout`, `webrender/swgl`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
What to do
The release job declares an environment, but its protection rules are not visible from the repository — confirm required reviewers are attached, or publish as a draft release so a bad build can be stopped before users can download it.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
Do you agree with this assessment?
R1 · Type Safety0.0 / 10Critical✓ 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.
0 typed · 10 plain JS — the untyped files are REDACTED, scripts/docs_pdf_book.mjs, scripts/docs_pdf_cdp.mjs, scripts/e2e-web/lib/asserts.mjs, scripts/e2e-web/lib/cdp.mjs, scripts/e2e-web/lib/driver.mjs (+4 more).
What to do
Adopt TypeScript for the frontend: add a typecheck step to the build, then either type-check the existing JavaScript in place (`checkJs`/JSDoc types) or convert the highest-traffic modules first — no file is typed today, so this is an adoption, not a clean-up.
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.
REDACTED:3534 · REDACTED:3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:3534
REDACTED:939 · REDACTED:1037 — all 2 copies are in the same file, 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. — REDACTED:939
REDACTED:4252 · REDACTED:4312 — all 2 copies are in the same file, 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. — REDACTED:4252
REDACTED:3153 · REDACTED:3181 — all 2 copies are in the same file, 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. — REDACTED:3153
REDACTED:2842 · REDACTED:2870 — all 2 copies are in the same file, 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. — REDACTED:2842
REDACTED:2255 · REDACTED:2580 — all 2 copies are in the same file, 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. — REDACTED:2255
REDACTED:2572 · REDACTED:2929 — all 2 copies are in the same file, 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. — REDACTED:2572
REDACTED:1408 · REDACTED:2236 · REDACTED:2993 — all 3 copies are in the same file, 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. — REDACTED:1408
REDACTED:1579 · REDACTED:2025 · REDACTED:2236 · REDACTED:2581 · +1 more site(s) not listed — all 5 copies are in the same file, 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. — REDACTED:1579
REDACTED:1923 · REDACTED:1935 — all 2 copies are in the same file, 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. — REDACTED:1923
REDACTED:2352 · REDACTED:2441 — all 2 copies are in the same file, 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. — REDACTED:2352
REDACTED:3137 · REDACTED:3167 — all 2 copies are in the same file, 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. — REDACTED:3137
REDACTED:3582 · REDACTED:3629 — all 2 copies are in the same file, 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. — REDACTED:3582
REDACTED:3828 · REDACTED:3950 — all 2 copies are in the same file, 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. — REDACTED:3828
REDACTED:3939 · REDACTED:4479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:3939
REDACTED:4130 · REDACTED:4230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:4130
REDACTED:1442 · REDACTED:1463 — all 2 copies are in the same file, 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. — REDACTED:1442
REDACTED:2915 · REDACTED:2964 — all 2 copies are in the same file, 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. — REDACTED:2915
REDACTED:3352 · REDACTED:3389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:3352
REDACTED:1697 · REDACTED:1705 — all 2 copies are in the same file, 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. — REDACTED:1697
REDACTED:1649 · REDACTED:4731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — REDACTED:1649
REDACTED:3707 · REDACTED:4128 · REDACTED:4201 · REDACTED:4228 — all 4 copies are in the same file, 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. — REDACTED:3707
REDACTED:2327 · REDACTED:2378 — all 2 copies are in the same file, 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. — REDACTED:2327
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.
runStep has cyclomatic complexity 69 and cognitive complexity 44; 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. — scripts/e2e-web/lib/driver.mjs:187
runAssert has cyclomatic complexity 53 and cognitive complexity 68; 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. — scripts/e2e-web/lib/asserts.mjs:53
runTest has cyclomatic complexity 42 and cognitive complexity 79; 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. — scripts/e2e-web/run.mjs:191
decodePng has cyclomatic complexity 39 and cognitive complexity 49; 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. — scripts/e2e-web/lib/png.mjs:22
main has cyclomatic complexity 37 and cognitive complexity 61; 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. — scripts/e2e-web/run.mjs:403
_renderTreeNode has cyclomatic complexity 29 and cognitive complexity 34; 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. — REDACTED:656
_loop has cyclomatic complexity 27 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. — REDACTED:4572
showComponentDetail has cyclomatic complexity 26 and cognitive complexity 28; 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. — REDACTED:2265
render has cyclomatic complexity 26 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3449
_parseSlashCommand has cyclomatic complexity 23 and cognitive complexity 48; 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. — REDACTED:4753
_loadComponentPreview has cyclomatic complexity 22 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 sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2590
parseArgs has cyclomatic complexity 22 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — scripts/e2e-web/run.mjs:88
init has cyclomatic complexity 21 and cognitive complexity 33; 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. — REDACTED:196
renderNodeDetail has cyclomatic complexity 21 and cognitive complexity 24; 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. — REDACTED:795
assertScreenshot 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. — scripts/e2e-web/lib/asserts.mjs:191
exportCode has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:1588
_loadNodeClipInfo has cyclomatic complexity 19 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. — REDACTED:1313
render has cyclomatic complexity 19 and cognitive complexity 3; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:3482
_addCollapsible has cyclomatic complexity 18 and cognitive complexity 35; 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. — REDACTED:3335
runTestsInTab has cyclomatic complexity 18 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. — scripts/e2e-web/run.mjs:333
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files6.0 / 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.
1 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: REDACTED (4426).
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?
R7 · Dead Code8.8 / 10Strong✓ 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.
Unreachable from the 2 application, 1 tooling and 7 test entry point(s) detected in this repo. This repository declares no build, type-check or test script, so nothing here would fail on a wrong deletion — confirm by hand that nothing loads each file (including by a path built at runtime) before removing it. An undetected custom entry would make these reachable.
no import path from any entry point (2 application, 1 tooling, 7 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) — scripts/docs_pdf_book.mjs, scripts/docs_pdf_cdp.mjs
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 · 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 · 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 · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. 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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. 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.
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 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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. 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.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 4 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 7 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 57 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC7 A11y enforcement — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX6 Interface segregation — no public interfaces
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 18 — an image could not be pulled) — victoriametrics Pulling grafana Pulling otel-collector Pulling loki Pulling otel-collector Error Get "https://registry-1.docker.io/v2/": Forbidden victoriametrics Error context canceled grafana Error context canceled loki Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: otel-collector Pulling victoriametrics Pulling grafana Pulling loki Pulling victoriametrics Error Get "https://registry-1.docker.io/v2/": Forbidden otel-collector Error Get "https://registry-1.docker.io/v2/": Forbidden grafana Error context canceled loki Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D10 Test Quality — ~198211 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D14 License Compliance — License Compliance not included (time budget)
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
D18 Solution Shape — D18 scores the shape of a .NET solution, but this repository's production source is mostly .adb, .bas, .c, .cob, .cpp, .cr, .f90, .go, .hs, .java, .jl, .kt, .lua, .ml, .nim, .pas, .php, .pl, .py, .rb, .rs, .scala, .swift, .v, .zig — the .NET project files present are an immaterial minority — so the dimension does not apply.
D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
D23 Boundary Type-Coupling — At only 1 project (and 1067264 LoC) this is a single-purpose codebase that needs no boundaries. No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Aggregate roots were found in only one source directory (layout), which is a layered codebase, not two contexts. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
D8 Code Coverage — Coverage NOT MEASURED: `--collect:"XPlat Code Coverage"` names a data collector that ships in the `coverlet.collector` package, and this repository wires up none — no test project references it and no runsettings declares one. The absence of coverage here is therefore not evidence about the suite or about our analyzer environment: without a collector, `--collect` produces nothing even from a suite that builds and passes. Add a `coverlet.collector` PackageReference to the test project(s) (or commit the Cobertura/OpenCover/lcov report your CI produces) and real coverage will be measured. It is excluded from the score rather than counted as a near-zero defect.
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 298 value object(s); 6 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
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, 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
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
P8 Schema migrations — no EF Core usage detected
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF3 Async & latency hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
R4 Test Coverage — 7 test file(s) reach none of 3 production file(s) via imports — exercised outside the JS import graph (integration/bundled), not import-reachable
R5 Dependency Freshness — no package-lock.json — dependency freshness not measured (would require an npm lockfile); JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
R6 Tooling — no package.json in the repository — test/lint/typecheck wiring is read from package.json scripts (corroborated against CI), so this project's own toolchain isn't measured here
R8 Dependency Hygiene — Not measured — no package.json declares any dependency, so there is nothing to check imports against (imports may resolve through a host runtime rather than node).
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X2 Cancellation propagation — no async methods found
X6 Hand-rolled structured-format parsing — 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.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: AsyncScreenshotGrabber.get_screenshot webrender/core/src/screen_capture.rs:110— `AsyncScreenshotGrabber.get_screenshot` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
azul_doc::main (cognitive 532) doc/src/main.rs:76— azul_doc::main has cognitive complexity 532 (threshold 15). Drivers by points: if/else 133 (304 pts), loops 44 (141 pts), match/switch 25 (71 pts), boolean chains 16 (nesting depth added 314). 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.
azul_doc::autofix::check_ffi_safety (cognitive 393) doc/src/autofix/mod.rs:1828— azul_doc::autofix::check_ffi_safety has cognitive complexity 393 (threshold 15). Drivers by points: if/else 61 (262 pts), loops 27 (85 pts), match/switch 7 (25 pts), boolean chains 21 (nesting depth added 277). 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.
azul_doc::reftest::apply_midlevel::run (cognitive 246) doc/src/reftest/apply_midlevel.rs:186— azul_doc::reftest::apply_midlevel::run has cognitive complexity 246 (threshold 15). Drivers by points: if/else 66 (184 pts), match/switch 12 (40 pts), loops 5 (17 pts), boolean chains 5 (nesting depth added 158). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::api::collect_all_referenced_types_from_api_with_chains (cognitive 230) doc/src/api.rs:1837— azul_doc::api::collect_all_referenced_types_from_api_with_chains has cognitive complexity 230 (threshold 15). Drivers by points: if/else 24 (161 pts), loops 14 (69 pts) (nesting depth added 192). 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.
azul_doc::patch::normalize_az_prefixes (cognitive 219) doc/src/patch/mod.rs:760— azul_doc::patch::normalize_az_prefixes has cognitive complexity 219 (threshold 15). Drivers by points: if/else 26 (147 pts), loops 15 (72 pts) (nesting depth added 178). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::api::find_unused_types_simulating_removal (cognitive 208) doc/src/api.rs:2278— azul_doc::api::find_unused_types_simulating_removal has cognitive complexity 208 (threshold 15). Drivers by points: if/else 21 (105 pts), loops 21 (84 pts), boolean chains 14, match/switch 2 (5 pts) (nesting depth added 150). 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.
azul_doc::autofix::debug::analyze_function_dependencies (cognitive 207) doc/src/autofix/debug.rs:1010— azul_doc::autofix::debug::analyze_function_dependencies has cognitive complexity 207 (threshold 15). Drivers by points: if/else 40 (152 pts), loops 23 (71 pts), boolean chains 2, match/switch 2 (nesting depth added 160). 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. This shape REPEATS in the file: one other method here (azul_doc::autofix::debug::analyze_function_dependencies::reaches_difficult) 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.
azul_doc::api::find_unused_types (cognitive 199) doc/src/api.rs:2009— azul_doc::api::find_unused_types has cognitive complexity 199 (threshold 15). Drivers by points: if/else 19 (97 pts), loops 21 (84 pts), boolean chains 13, match/switch 2 (5 pts) (nesting depth added 144). 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.
azul_doc::patch::apply_class_patch (cognitive 154) doc/src/patch/mod.rs:1100— azul_doc::patch::apply_class_patch has cognitive complexity 154 (threshold 15). Drivers by points: if/else 58 (96 pts), loops 14 (56 pts), boolean chains 2 (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::autofix::function_diff::generate_add_type_patches (cognitive 152) doc/src/autofix/function_diff.rs:1192— azul_doc::autofix::function_diff::generate_add_type_patches has cognitive complexity 152 (threshold 15). Drivers by points: if/else 38 (111 pts), loops 8 (24 pts), match/switch 4 (10 pts), boolean chains 7 (nesting depth added 95). 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.
azul_doc::autofix::workspace::generate_patches (cognitive 149) doc/src/autofix/workspace.rs:432— azul_doc::autofix::workspace::generate_patches has cognitive complexity 149 (threshold 15). Drivers by points: if/else 43 (107 pts), loops 13 (18 pts), match/switch 6 (15 pts), boolean chains 9 (nesting depth added 78). 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.
azul_doc::patch::update_type_references (cognitive 139) doc/src/patch/mod.rs:1906— azul_doc::patch::update_type_references has cognitive complexity 139 (threshold 15). Drivers by points: if/else 17 (84 pts), loops 13 (55 pts) (nesting depth added 109). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::dllgen::deploy::verify_examples (cognitive 125) doc/src/dllgen/deploy.rs:21— azul_doc::dllgen::deploy::verify_examples has cognitive complexity 125 (threshold 15). Drivers by points: if/else 28 (106 pts), loops 6 (17 pts), boolean chains 2 (nesting depth added 89). 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.
azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body (cognitive 119) doc/src/codegen/v2/transmute_helpers.rs:109— azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body has cognitive complexity 119 (threshold 15). Drivers by points: if/else 52 (100 pts), boolean chains 15, loops 3 (4 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::autofix::debug::debug_type_in_index (cognitive 118) doc/src/autofix/debug.rs:18— azul_doc::autofix::debug::debug_type_in_index has cognitive complexity 118 (threshold 15). Drivers by points: if/else 22 (81 pts), loops 6 (24 pts), match/switch 4 (13 pts) (nesting depth added 86). 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.
azul_doc::reftest::autodebug::discover_failing_tests (cognitive 117) doc/src/reftest/autodebug.rs:987— azul_doc::reftest::autodebug::discover_failing_tests has cognitive complexity 117 (threshold 15). Drivers by points: if/else 39 (84 pts), loops 10 (21 pts), boolean chains 6, match/switch 4 (6 pts) (nesting depth added 58). 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.
azul_doc::autofix::diff::resolve_api_functions_with_workspace_index (cognitive 114) doc/src/autofix/diff.rs:781— azul_doc::autofix::diff::resolve_api_functions_with_workspace_index has cognitive complexity 114 (threshold 15). Drivers by points: loops 14 (69 pts), if/else 10 (45 pts) (nesting depth added 90). 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.
azul_doc::autofix::diff::find_dead_type_clusters (cognitive 106) doc/src/autofix/diff.rs:1491— azul_doc::autofix::diff::find_dead_type_clusters has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (73 pts), loops 14 (31 pts), boolean chains 2 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::autofix::type_index::extract_custom_impls_from_items (cognitive 100) doc/src/autofix/type_index.rs:2890— azul_doc::autofix::type_index::extract_custom_impls_from_items has cognitive complexity 100 (threshold 15). Drivers by points: if/else 20 (74 pts), loops 6 (25 pts), boolean chains 1 (nesting depth added 73). 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.
azul_doc::autofix::check_doc_characters (cognitive 99) doc/src/autofix/mod.rs:3093— azul_doc::autofix::check_doc_characters has cognitive complexity 99 (threshold 15). Drivers by points: if/else 14 (71 pts), loops 8 (28 pts) (nesting depth added 77). Of this number, 96 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method (cognitive 94) doc/src/codegen/v2/lang_csharp/wrappers.rs:1419— azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method has cognitive complexity 94 (threshold 15). Drivers by points: if/else 47 (63 pts), match/switch 6 (14 pts), loops 6 (10 pts), boolean chains 7 (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.
azul_doc::patch::parser::organize_symbols (cognitive 92) doc/src/patch/parser.rs:932— azul_doc::patch::parser::organize_symbols has cognitive complexity 92 (threshold 15). Drivers by points: if/else 20 (75 pts), loops 7 (12 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 62). 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.
azul_doc::patch::index::extract_types_from_file (cognitive 92) doc/src/patch/index.rs:1196— azul_doc::patch::index::extract_types_from_file has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (69 pts), loops 6 (13 pts), match/switch 3 (9 pts), boolean chains 1 (nesting depth added 60). 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.
azul_doc::autofix::debug::analyze_ffi_difficulty (cognitive 90) doc/src/autofix/debug.rs:706— azul_doc::autofix::debug::analyze_ffi_difficulty has cognitive complexity 90 (threshold 15). Drivers by points: if/else 16 (54 pts), loops 12 (34 pts), match/switch 2 (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.
azul_doc::autofix::autofix_api (cognitive 89) doc/src/autofix/mod.rs:133— azul_doc::autofix::autofix_api has cognitive complexity 89 (threshold 15). Drivers by points: if/else 27 (50 pts), loops 15 (23 pts), match/switch 4 (15 pts), boolean chains 1 (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.
FunctionTooLong: azul_dll::desktop::compositor2::translate_displaylist_to_wr dll/src/desktop/compositor2.rs:174— FunctionTooLong — azul_dll::desktop::compositor2::translate_displaylist_to_wr runs 1483 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1383 over it, 14.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::main doc/src/main.rs:76— FunctionTooLong — azul_doc::main runs 1375 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1275 over it, 13.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_dll::desktop::shell2::windows::window_proc dll/src/desktop/shell2/windows/mod.rs:4025— FunctionTooLong — azul_dll::desktop::shell2::windows::window_proc runs 1359 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1259 over it, 13.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::solver3::fc::layout_bfc layout/src/solver3/fc.rs:1214— FunctionTooLong — azul_layout::solver3::fc::layout_bfc runs 1127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1027 over it, 11.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::widgets::node_graph::render_node layout/src/widgets/node_graph.rs:1291— FunctionTooLong — azul_layout::widgets::node_graph::render_node runs 1082 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 982 over it, 10.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::solver3::fc::collect_and_measure_inline_content_impl layout/src/solver3/fc.rs:8628— FunctionTooLong — azul_layout::solver3::fc::collect_and_measure_inline_content_impl runs 671 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 571 over it, 6.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.
FunctionTooLong: azul_layout::cpurender::raster::render_single_item layout/src/cpurender/raster.rs:1830— FunctionTooLong — azul_layout::cpurender::raster::render_single_item runs 660 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 560 over it, 6.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_dll::desktop::shell2::common::layout::regenerate_layout dll/src/desktop/shell2/common/layout.rs:236— FunctionTooLong — azul_dll::desktop::shell2::common::layout::regenerate_layout runs 639 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 539 over it, 6.39× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::event_determination::determine_all_events layout/src/event_determination.rs:599— FunctionTooLong — azul_layout::event_determination::determine_all_events runs 630 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 530 over it, 6.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: webrender::prepare::prepare_interned_prim_for_render webrender/core/src/prepare.rs:316— FunctionTooLong — webrender::prepare::prepare_interned_prim_for_render runs 594 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 494 over it, 5.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::autofix::type_index::extract_macro_generated_types doc/src/autofix/type_index.rs:1990— FunctionTooLong — azul_doc::autofix::type_index::extract_macro_generated_types runs 586 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 486 over it, 5.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.
FunctionTooLong: azul_doc::reftest::regression::generate_visual_html_report doc/src/reftest/regression.rs:2056— FunctionTooLong — azul_doc::reftest::regression::generate_visual_html_report runs 583 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 483 over it, 5.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_css::props::property::format_static_css_prop css/src/props/property.rs:7917— FunctionTooLong — azul_css::props::property::format_static_css_prop runs 575 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 475 over it, 5.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::solver3::fc::translate_to_text3_constraints layout/src/solver3/fc.rs:4623— FunctionTooLong — azul_layout::solver3::fc::translate_to_text3_constraints runs 563 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 463 over it, 5.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::reftest::apply_midlevel::run doc/src/reftest/apply_midlevel.rs:186— FunctionTooLong — azul_doc::reftest::apply_midlevel::run runs 562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 462 over it, 5.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_css::props::property::parse_combined_css_property css/src/props/property.rs:3689— FunctionTooLong — azul_css::props::property::parse_combined_css_property runs 544 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 444 over it, 5.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::autofix::autofix_api doc/src/autofix/mod.rs:133— FunctionTooLong — azul_doc::autofix::autofix_api runs 510 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 410 over it, 5.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::scroll_timer::scroll_physics_timer_callback layout/src/scroll_timer.rs:334— FunctionTooLong — azul_layout::scroll_timer::scroll_physics_timer_callback runs 469 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 369 over it, 4.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::autofix::check_ffi_safety doc/src/autofix/mod.rs:1828— FunctionTooLong — azul_doc::autofix::check_ffi_safety runs 448 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 348 over it, 4.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::text3::cache::shape_visual_items layout/src/text3/cache.rs:9473— FunctionTooLong — azul_layout::text3::cache::shape_visual_items runs 415 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 315 over it, 4.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: webrender::quad::prepare_quad webrender/core/src/quad.rs:66— FunctionTooLong — webrender::quad::prepare_quad runs 415 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 315 over it, 4.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::solver3::fc::layout_ifc layout/src/solver3/fc.rs:3570— FunctionTooLong — azul_layout::solver3::fc::layout_ifc runs 413 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 313 over it, 4.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_layout::solver3::cache::reconcile_recursive layout/src/solver3/cache.rs:1540— FunctionTooLong — azul_layout::solver3::cache::reconcile_recursive runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_core::compact::apply_css_property_to_compact core/src/compact.rs:1305— FunctionTooLong — azul_core::compact::apply_css_property_to_compact runs 394 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 294 over it, 3.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: azul_doc::autofix::print_single_warning doc/src/autofix/mod.rs:2599— FunctionTooLong — azul_doc::autofix::print_single_warning runs 394 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 294 over it, 3.94× 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.
azul_layout::solver3::fc::layout_bfc (cognitive 295) layout/src/solver3/fc.rs:1214— azul_layout::solver3::fc::layout_bfc has cognitive complexity 295 (threshold 15). Drivers by points: if/else 109 (248 pts), boolean chains 30, loops 6 (11 pts), match/switch 4 (6 pts) (nesting depth added 146). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
azul_layout::solver3::positioning::position_out_of_flow_elements (cognitive 225) layout/src/solver3/positioning.rs:160— azul_layout::solver3::positioning::position_out_of_flow_elements has cognitive complexity 225 (threshold 15). Drivers by points: if/else 65 (170 pts), boolean chains 26, match/switch 6 (19 pts), loops 3 (10 pts) (nesting depth added 125). 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.
azul_layout::xml::parse_xml_to_fast_dom_with_css (cognitive 220) layout/src/xml/mod.rs:334— azul_layout::xml::parse_xml_to_fast_dom_with_css has cognitive complexity 220 (threshold 15). Drivers by points: if/else 58 (182 pts), loops 8 (17 pts), match/switch 6 (15 pts), boolean chains 6 (nesting depth added 142). Of this number, 216 points are the body's own statements and 4 belong to one function item 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.
azul_layout::solver3::layout_document (cognitive 213) layout/src/solver3/mod.rs:544— azul_layout::solver3::layout_document has cognitive complexity 213 (threshold 15). Drivers by points: if/else 69 (157 pts), loops 17 (36 pts), boolean chains 14, match/switch 3 (6 pts) (nesting depth added 110). Of this number, 208 points are the body's own statements and 5 belong to one function item 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.
azul_layout::scroll_timer::scroll_physics_timer_callback (cognitive 209) layout/src/scroll_timer.rs:334— azul_layout::scroll_timer::scroll_physics_timer_callback has cognitive complexity 209 (threshold 15). Drivers by points: if/else 55 (148 pts), boolean chains 40, loops 10 (11 pts), match/switch 5 (10 pts) (nesting depth added 99). 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.
azul_layout::event_determination::determine_all_events (cognitive 191) layout/src/event_determination.rs:599— azul_layout::event_determination::determine_all_events has cognitive complexity 191 (threshold 15). Drivers by points: if/else 71 (140 pts), boolean chains 26, loops 10 (13 pts), match/switch 4 (12 pts) (nesting depth added 80). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::text3::cache::shape_visual_items (cognitive 164) layout/src/text3/cache.rs:9473— azul_layout::text3::cache::shape_visual_items has cognitive complexity 164 (threshold 15). Drivers by points: if/else 35 (112 pts), loops 9 (34 pts), match/switch 5 (16 pts), boolean chains 2 (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::text3::cache::position_one_line (cognitive 161) layout/src/text3/cache.rs:11839— azul_layout::text3::cache::position_one_line has cognitive complexity 161 (threshold 15). Drivers by points: if/else 55 (135 pts), boolean chains 12, match/switch 4 (9 pts), loops 3 (5 pts) (nesting depth added 87). 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.
azul_layout::solver3::cache::reconcile_recursive (cognitive 160) layout/src/solver3/cache.rs:1540— azul_layout::solver3::cache::reconcile_recursive has cognitive complexity 160 (threshold 15). Drivers by points: if/else 51 (136 pts), loops 4 (14 pts), boolean chains 8, match/switch 2 (nesting depth added 95). 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.
azul_layout::text3::cache::perform_fragment_layout (cognitive 151) layout/src/text3/cache.rs:10761— azul_layout::text3::cache::perform_fragment_layout has cognitive complexity 151 (threshold 15). Drivers by points: if/else 46 (118 pts), match/switch 4 (14 pts), loops 5 (11 pts), boolean chains 8 (nesting depth added 88). 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.
azul_layout::solver3::fc::position_table_cells (cognitive 131) layout/src/solver3/fc.rs:7936— azul_layout::solver3::fc::position_table_cells has cognitive complexity 131 (threshold 15). Drivers by points: if/else 38 (100 pts), loops 8 (17 pts), match/switch 4 (13 pts), boolean chains 1 (nesting depth added 80). 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.
azul_layout::cpurender::raster::render_single_item (cognitive 124) layout/src/cpurender/raster.rs:1830— azul_layout::cpurender::raster::render_single_item has cognitive complexity 124 (threshold 15). Drivers by points: if/else 34 (91 pts), loops 7 (24 pts), boolean chains 8, match/switch 1 (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::solver3::display_list::paginate_pages_impl (cognitive 121) layout/src/solver3/display_list.rs:9684— azul_layout::solver3::display_list::paginate_pages_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 30 (80 pts), loops 11 (30 pts), boolean chains 9, match/switch 1 (2 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.
azul_layout::cpurender::compositor::compute_display_list_damage_impl (cognitive 121) layout/src/cpurender/compositor.rs:2982— azul_layout::cpurender::compositor::compute_display_list_damage_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 30 (102 pts), boolean chains 10, match/switch 2 (8 pts), loops 1 (nesting depth added 78). 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.
azul_layout::solver3::fc::collect_and_measure_inline_content_impl (cognitive 121) layout/src/solver3/fc.rs:8628— azul_layout::solver3::fc::collect_and_measure_inline_content_impl has cognitive complexity 121 (threshold 15). Drivers by points: if/else 45 (99 pts), match/switch 4 (11 pts), loops 3 (7 pts), boolean chains 4 (nesting depth added 65). 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.
azul_layout::solver3::fc::translate_to_text3_constraints (cognitive 120) layout/src/solver3/fc.rs:4623— azul_layout::solver3::fc::translate_to_text3_constraints has cognitive complexity 120 (threshold 15). Drivers by points: if/else 64 (75 pts), match/switch 28 (43 pts), boolean chains 2 (nesting depth added 26). 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.
azul_layout::solver3::fc::layout_ifc (cognitive 105) layout/src/solver3/fc.rs:3570— azul_layout::solver3::fc::layout_ifc has cognitive complexity 105 (threshold 15). Drivers by points: if/else 36 (79 pts), match/switch 9 (13 pts), loops 5 (10 pts), boolean chains 3 (nesting depth added 52). 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.
azul_layout::text3::cache::break_one_line (cognitive 100) layout/src/text3/cache.rs:11352— azul_layout::text3::cache::break_one_line has cognitive complexity 100 (threshold 15). Drivers by points: if/else 26 (78 pts), loops 5 (14 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 65). 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.
azul_layout::text3::cache::create_logical_items (cognitive 96) layout/src/text3/cache.rs:8352— azul_layout::text3::cache::create_logical_items has cognitive complexity 96 (threshold 15). Drivers by points: if/else 24 (74 pts), match/switch 3 (9 pts), loops 4 (8 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.
azul_layout::solver3::sizing::calculate_used_size_for_node (cognitive 85) layout/src/solver3/sizing.rs:1730— azul_layout::solver3::sizing::calculate_used_size_for_node has cognitive complexity 85 (threshold 15). Drivers by points: if/else 41 (52 pts), match/switch 12 (21 pts), boolean chains 12 (nesting depth added 20). 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.
azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes (cognitive 84) layout/src/widgets/node_graph.rs:3109— azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes has cognitive complexity 84 (threshold 15). Drivers by points: if/else 28 (63 pts), match/switch 6 (13 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::solver3::cache::calculate_layout_for_subtree_fragment (cognitive 83) layout/src/solver3/cache.rs:3020— azul_layout::solver3::cache::calculate_layout_for_subtree_fragment has cognitive complexity 83 (threshold 15). Drivers by points: if/else 29 (60 pts), match/switch 5 (10 pts), boolean chains 8, loops 2 (5 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::solver3::display_list::split_text_for_glides (cognitive 81) layout/src/solver3/display_list.rs:702— azul_layout::solver3::display_list::split_text_for_glides has cognitive complexity 81 (threshold 15). Drivers by points: if/else 17 (54 pts), loops 5 (15 pts), boolean chains 7, match/switch 1 (5 pts) (nesting depth added 51). Of this number, 80 points are the body's own statements and 1 belongs to one function item 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.
azul_layout::solver3::getters::get_style_properties_for_state (cognitive 74) layout/src/solver3/getters.rs:3042— azul_layout::solver3::getters::get_style_properties_for_state has cognitive complexity 74 (threshold 15). Drivers by points: if/else 41 (68 pts), match/switch 5, boolean chains 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_layout::solver3::fc::calculate_row_heights (cognitive 71) layout/src/solver3/fc.rs:7730— azul_layout::solver3::fc::calculate_row_heights has cognitive complexity 71 (threshold 15). Drivers by points: if/else 18 (53 pts), loops 8 (16 pts), boolean chains 2 (nesting depth added 43). 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.
Hotspot: dll/src/desktop/shell2/common/event.rs dll/src/desktop/shell2/common/event.rs:4824— dll/src/desktop/shell2/common/event.rs changed 221 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 315 in PlatformWindow::apply_user_change at line 4824. 102 of those changes were fix/bug commits, and the other 119 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/event.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/window.rs layout/src/window.rs:5543— layout/src/window.rs changed 338 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 89 in LayoutWindow::layout_dom_recursive_impl at line 5543. 137 of those changes were fix/bug commits, and the other 201 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/window.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/windows/mod.rs dll/src/desktop/shell2/windows/mod.rs:4025— dll/src/desktop/shell2/windows/mod.rs changed 106 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 205 in azul_dll::desktop::shell2::windows::window_proc at line 4025. 58 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/windows/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/linux/wayland/mod.rs dll/src/desktop/shell2/linux/wayland/mod.rs:7011— dll/src/desktop/shell2/linux/wayland/mod.rs changed 149 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 104 in WaylandWindow::generate_frame_if_needed at line 7011. 79 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/linux/wayland/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/headless/mod.rs dll/src/desktop/shell2/headless/mod.rs:2258— dll/src/desktop/shell2/headless/mod.rs changed 128 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 92 in HeadlessWindow::run at line 2258. 73 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/headless/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: doc/src/main.rs doc/src/main.rs:76— doc/src/main.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 266 in azul_doc::main at line 76. 16 of those changes were fix/bug commits, and the other 26 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/solver3/fc.rs layout/src/solver3/fc.rs:1214— layout/src/solver3/fc.rs changed 89 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in azul_layout::solver3::fc::layout_bfc at line 1214. 35 of those changes were fix/bug commits, and the other 54 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/solver3/fc.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/dom.rs core/src/dom.rs:692— core/src/dom.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 184 in NodeType::to_library_owned_nodetype at line 692. 14 of those changes were fix/bug commits, and the other 33 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/dom.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/cpurender/raster.rs layout/src/cpurender/raster.rs:1830— layout/src/cpurender/raster.rs changed 101 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in azul_layout::cpurender::raster::render_single_item at line 1830. 38 of those changes were fix/bug commits, and the other 63 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/cpurender/raster.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/linux/x11/mod.rs dll/src/desktop/shell2/linux/x11/mod.rs:4836— dll/src/desktop/shell2/linux/x11/mod.rs changed 119 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in X11Window::handle_event at line 4836. 61 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/linux/x11/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/xml.rs core/src/xml.rs:2670— core/src/xml.rs changed 48 times in last 90 days, max cyclomatic complexity 170 in azul_core::xml::tag_to_node_type at line 2670. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/xml.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/text3/cache.rs layout/src/text3/cache.rs:11839— layout/src/text3/cache.rs changed 111 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in azul_layout::text3::cache::position_one_line at line 11839. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/text3/cache.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/events.rs core/src/events.rs:2038— core/src/events.rs changed 92 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in azul_core::events::matches_window_filter at line 2038. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/events.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/solver3/display_list.rs layout/src/solver3/display_list.rs:1883— layout/src/solver3/display_list.rs changed 120 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in DisplayListItem::is_visually_equal at line 1883. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/solver3/display_list.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/callbacks.rs layout/src/callbacks.rs:3680— layout/src/callbacks.rs changed 136 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in CallbackInfo::get_node_attribute at line 3680. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/callbacks.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/macos/mod.rs dll/src/desktop/shell2/macos/mod.rs:7700— dll/src/desktop/shell2/macos/mod.rs changed 105 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in MacOSWindow::render_and_present_in_draw_rect at line 7700. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/macos/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/solver3/mod.rs layout/src/solver3/mod.rs:544— layout/src/solver3/mod.rs changed 54 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in azul_layout::solver3::layout_document at line 544. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/solver3/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/common/layout.rs dll/src/desktop/shell2/common/layout.rs:236— dll/src/desktop/shell2/common/layout.rs changed 65 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in azul_dll::desktop::shell2::common::layout::regenerate_layout at line 236. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/layout.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/compact.rs core/src/compact.rs:1305— core/src/compact.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 190 in azul_core::compact::apply_css_property_to_compact at line 1305. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/compact.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: css/src/props/property.rs css/src/props/property.rs:3216— css/src/props/property.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 195 in azul_css::props::property::parse_css_property at line 3216. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- css/src/props/property.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/ua_css.rs core/src/ua_css.rs:620— core/src/ua_css.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 213 in azul_core::ua_css::get_ua_property at line 620. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/ua_css.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: layout/src/event_determination.rs layout/src/event_determination.rs:599— layout/src/event_determination.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 114 in azul_layout::event_determination::determine_all_events at line 599. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/event_determination.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/src/prop_cache.rs core/src/prop_cache.rs:2149— core/src/prop_cache.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in CssPropertyCache::get_computed_css_style_string at line 2149. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/prop_cache.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/desktop/shell2/android/mod.rs dll/src/desktop/shell2/android/mod.rs:1262— dll/src/desktop/shell2/android/mod.rs changed 64 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 68 in azul_dll::desktop::shell2::android::drain_input at line 1262. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/android/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: dll/src/web/transpiler_remill.rs dll/src/web/transpiler_remill.rs:2167— dll/src/web/transpiler_remill.rs changed 50 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in RemillTranspiler::lift_with_transitive_deps_sequential at line 2167. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/web/transpiler_remill.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
FileTooLong: src/window.rs layout/src/window.rs— FileTooLong — 11355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 10855 over it, 22.71× 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: text3/cache.rs layout/src/text3/cache.rs— FileTooLong — 7600 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 80 free functions. The bar is 500 significant lines; this is 7100 over it, 15.20× 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: props/property.rs css/src/props/property.rs— FileTooLong — 6726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 6226 over it, 13.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: common/event.rs dll/src/desktop/shell2/common/event.rs— FileTooLong — 6645 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 6145 over it, 13.29× 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: solver3/display_list.rs layout/src/solver3/display_list.rs— FileTooLong — 6562 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 6062 over it, 13.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: web/transpiler_remill.rs dll/src/web/transpiler_remill.rs— FileTooLong — 6346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 98 free functions. The bar is 500 significant lines; this is 5846 over it, 12.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: solver3/fc.rs layout/src/solver3/fc.rs— FileTooLong — 6174 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 73 free functions. The bar is 500 significant lines; this is 5674 over it, 12.35× 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: wayland/mod.rs dll/src/desktop/shell2/linux/wayland/mod.rs— FileTooLong — 6037 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: WaylandWindow (7 blocks, 544-11092). The bar is 500 significant lines; this is 5537 over it, 12.07× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/xml.rs core/src/xml.rs— FileTooLong — 5574 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 85 free functions. The bar is 500 significant lines; this is 5074 over it, 11.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: macos/mod.rs dll/src/desktop/shell2/macos/mod.rs— FileTooLong — 4973 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 4473 over it, 9.95× 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: x11/mod.rs dll/src/desktop/shell2/linux/x11/mod.rs— FileTooLong — 4866 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: X11Window (11 blocks, 1743-8843), declaring 34 free functions. The bar is 500 significant lines; this is 4366 over it, 9.73× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/picture.rs webrender/core/src/picture.rs— FileTooLong — 4641 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 4141 over it, 9.28× 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: windows/mod.rs dll/src/desktop/shell2/windows/mod.rs— FileTooLong — 4127 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 3627 over it, 8.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: src/dom.rs core/src/dom.rs— FileTooLong — 4042 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 3542 over it, 8.08× 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: solver3/getters.rs layout/src/solver3/getters.rs— FileTooLong — 4040 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 195 free functions. The bar is 500 significant lines; this is 3540 over it, 8.08× 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: renderer/mod.rs webrender/core/src/renderer/mod.rs— FileTooLong — 3739 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: Renderer (3 blocks, 761-5971). The bar is 500 significant lines; this is 3239 over it, 7.48× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cpurender/raster.rs layout/src/cpurender/raster.rs— FileTooLong — 3522 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 3022 over it, 7.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 3378 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 2878 over it, 6.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/prop_cache.rs core/src/prop_cache.rs— FileTooLong — 3300 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: CssPropertyCache (5 blocks, 1017-5395). The bar is 500 significant lines; this is 2800 over it, 6.60× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/callbacks.rs layout/src/callbacks.rs— FileTooLong — 3105 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: CallbackInfo (3 blocks, 1162-7027). The bar is 500 significant lines; this is 2605 over it, 6.21× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/gl.rs core/src/gl.rs— FileTooLong — 3001 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2501 over it, 6.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/scene_building.rs webrender/core/src/scene_building.rs— FileTooLong — 3001 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: SceneBuilder (2 blocks, 434-4302). The bar is 500 significant lines; this is 2501 over it, 6.00× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: device/gl.rs webrender/core/src/device/gl.rs— FileTooLong — 2917 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2417 over it, 5.83× 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: wayland/events.rs dll/src/desktop/shell2/linux/wayland/events.rs— FileTooLong — 2811 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 169 free functions. The bar is 500 significant lines; this is 2311 over it, 5.62× 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/batch.rs webrender/core/src/batch.rs— FileTooLong — 2766 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: BatchBuilder (2 blocks, 729-3635). The bar is 500 significant lines; this is 2266 over it, 5.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
azul_doc::main (cyclomatic 266) doc/src/main.rs:76— azul_doc::main has cyclomatic complexity 266 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::autofix::check_ffi_safety (cyclomatic 117) doc/src/autofix/mod.rs:1828— azul_doc::autofix::check_ffi_safety has cyclomatic complexity 117 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::reftest::apply_midlevel::run (cyclomatic 85) doc/src/reftest/apply_midlevel.rs:186— azul_doc::reftest::apply_midlevel::run has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::autofix::autofix_api (cyclomatic 81) doc/src/autofix/mod.rs:133— azul_doc::autofix::autofix_api has cyclomatic complexity 81 (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.
azul_doc::autofix::workspace::generate_patches (cyclomatic 73) doc/src/autofix/workspace.rs:432— azul_doc::autofix::workspace::generate_patches has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::autofix::debug::analyze_function_dependencies (cyclomatic 63) doc/src/autofix/debug.rs:1010— azul_doc::autofix::debug::analyze_function_dependencies has cyclomatic complexity 63 (threshold 15). Of this number, 53 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::patch::apply_class_patch (cyclomatic 63) doc/src/patch/mod.rs:1100— azul_doc::patch::apply_class_patch has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method (cyclomatic 61) doc/src/codegen/v2/lang_csharp/wrappers.rs:1419— azul_doc::codegen::v2::lang_csharp::wrappers::emit_wrapper_method 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.
azul_doc::api::find_unused_types_simulating_removal (cyclomatic 59) doc/src/api.rs:2278— azul_doc::api::find_unused_types_simulating_removal 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.
azul_doc::api::find_unused_types (cyclomatic 56) doc/src/api.rs:2009— azul_doc::api::find_unused_types 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.
azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body (cyclomatic 55) doc/src/codegen/v2/transmute_helpers.rs:109— azul_doc::codegen::v2::transmute_helpers::generate_transmuted_fn_body 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.
azul_doc::reftest::autodebug::discover_failing_tests (cyclomatic 53) doc/src/reftest/autodebug.rs:987— azul_doc::reftest::autodebug::discover_failing_tests 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.
azul_doc::autofix::function_diff::generate_add_type_patches (cyclomatic 52) doc/src/autofix/function_diff.rs:1192— azul_doc::autofix::function_diff::generate_add_type_patches 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.
azul_doc::codegen::v2::lang_haskell::wrappers::emit_function (cyclomatic 49) doc/src/codegen/v2/lang_haskell/wrappers.rs:2049— azul_doc::codegen::v2::lang_haskell::wrappers::emit_function 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.
azul_doc::reftest::autodoc::build_autodoc_prompt (cyclomatic 47) doc/src/reftest/autodoc.rs:345— azul_doc::reftest::autodoc::build_autodoc_prompt 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.
azul_doc::autofix::module_map::module_from_external_path (cyclomatic 42) doc/src/autofix/module_map.rs:802— azul_doc::autofix::module_map::module_from_external_path has cyclomatic complexity 42 (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.
azul_doc::patch::normalize_az_prefixes (cyclomatic 41) doc/src/patch/mod.rs:760— azul_doc::patch::normalize_az_prefixes has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_doc::autofix::diff::find_dead_type_clusters (cyclomatic 40) doc/src/autofix/diff.rs:1491— azul_doc::autofix::diff::find_dead_type_clusters 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.
azul_doc::api::collect_all_referenced_types_from_api_with_chains (cyclomatic 39) doc/src/api.rs:1837— azul_doc::api::collect_all_referenced_types_from_api_with_chains 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.
azul_doc::gene2e::parse_schema (cyclomatic 39) doc/src/gene2e.rs:641— azul_doc::gene2e::parse_schema 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.
azul_doc::codegen::v2::lang_lua::cdef::strip_preprocessor (cyclomatic 39) doc/src/codegen/v2/lang_lua/cdef.rs:175— azul_doc::codegen::v2::lang_lua::cdef::strip_preprocessor 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.
azul_doc::autofix::diff::generate_diff_v2 (cyclomatic 38) doc/src/autofix/diff.rs:1111— azul_doc::autofix::diff::generate_diff_v2 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.
azul_doc::lint_examples::check_line (cyclomatic 36) doc/src/lint_examples.rs:442— azul_doc::lint_examples::check_line 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.
azul_doc::autofix::generate_combined_patch (cyclomatic 35) doc/src/autofix/mod.rs:839— azul_doc::autofix::generate_combined_patch has cyclomatic complexity 35 (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.
azul_doc::dllgen::deploy::verify_examples (cyclomatic 35) doc/src/dllgen/deploy.rs:21— azul_doc::dllgen::deploy::verify_examples 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.
azul_dll::desktop::shell2::windows::window_proc (cognitive 372) dll/src/desktop/shell2/windows/mod.rs:4025— azul_dll::desktop::shell2::windows::window_proc has cognitive complexity 372 (threshold 15). Drivers by points: if/else 129 (315 pts), match/switch 15 (38 pts), boolean chains 15, loops 1 (4 pts) (nesting depth added 212). 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.
azul_dll::desktop::compositor2::translate_displaylist_to_wr (cognitive 187) dll/src/desktop/compositor2.rs:174— azul_dll::desktop::compositor2::translate_displaylist_to_wr has cognitive complexity 187 (threshold 15). Drivers by points: if/else 57 (142 pts), match/switch 13 (37 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 112). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::desktop::shell2::common::layout::regenerate_layout (cognitive 183) dll/src/desktop/shell2/common/layout.rs:236— azul_dll::desktop::shell2::common::layout::regenerate_layout has cognitive complexity 183 (threshold 15). Drivers by points: if/else 48 (117 pts), loops 18 (43 pts), match/switch 6 (12 pts), boolean chains 11 (nesting depth added 100). 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.
azul_dll::desktop::shell2::run::run (cognitive 171) dll/src/desktop/shell2/run.rs:1963— azul_dll::desktop::shell2::run::run has cognitive complexity 171 (threshold 15). Drivers by points: if/else 31 (109 pts), loops 10 (32 pts), match/switch 11 (29 pts), boolean chains 1 (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::desktop::shell2::linux::x11::init_xinput2 (cognitive 138) dll/src/desktop/shell2/linux/x11/mod.rs:866— azul_dll::desktop::shell2::linux::x11::init_xinput2 has cognitive complexity 138 (threshold 15). Drivers by points: if/else 46 (113 pts), boolean chains 12, loops 5 (12 pts), match/switch 1 (nesting depth added 74). 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.
azul_dll::desktop::extra::video_codec::stream::decode_stream (cognitive 132) dll/src/desktop/extra/video_codec/stream.rs:96— azul_dll::desktop::extra::video_codec::stream::decode_stream has cognitive complexity 132 (threshold 15). Drivers by points: if/else 28 (95 pts), match/switch 7 (20 pts), loops 5 (15 pts), boolean chains 2 (nesting depth added 90). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::desktop::shell2::android::drain_input (cognitive 130) dll/src/desktop/shell2/android/mod.rs:1262— azul_dll::desktop::shell2::android::drain_input has cognitive complexity 130 (threshold 15). Drivers by points: if/else 38 (97 pts), match/switch 11 (21 pts), loops 5 (7 pts), boolean chains 5 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::web::symbol_table::classify_for_name (cognitive 127) dll/src/web/symbol_table.rs:2437— azul_dll::web::symbol_table::classify_for_name has cognitive complexity 127 (threshold 15). Drivers by points: if/else 49 (80 pts), boolean chains 36, loops 6 (7 pts), match/switch 2 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges (cognitive 112) dll/src/web/symbol_table.rs:3247— azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges has cognitive complexity 112 (threshold 15). Drivers by points: if/else 19 (66 pts), loops 9 (28 pts), boolean chains 12, match/switch 3 (6 pts) (nesting depth added 69). 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.
azul_dll::web::transpiler_remill::collect_synth_data_pages (cognitive 110) dll/src/web/transpiler_remill.rs:4742— azul_dll::web::transpiler_remill::collect_synth_data_pages has cognitive complexity 110 (threshold 15). Drivers by points: if/else 28 (75 pts), loops 11 (30 pts), boolean chains 5 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::desktop::shell2::run::run (cognitive 94) dll/src/desktop/shell2/run.rs:1477— azul_dll::desktop::shell2::run::run has cognitive complexity 94 (threshold 15). Drivers by points: if/else 22 (68 pts), loops 9 (20 pts), match/switch 2 (6 pts) (nesting depth added 61). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::desktop::shell2::linux::x11::handle_xi_device_event (cognitive 93) dll/src/desktop/shell2/linux/x11/mod.rs:2048— azul_dll::desktop::shell2::linux::x11::handle_xi_device_event has cognitive complexity 93 (threshold 15). Drivers by points: if/else 30 (64 pts), match/switch 8 (24 pts), boolean chains 5 (nesting depth added 50). 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.
azul_dll::desktop::shell2::ios::handle_touch (cognitive 90) dll/src/desktop/shell2/ios/mod.rs:331— azul_dll::desktop::shell2::ios::handle_touch has cognitive complexity 90 (threshold 15). Drivers by points: if/else 32 (72 pts), loops 3 (8 pts), match/switch 5 (6 pts), boolean chains 4 (nesting depth added 46). 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.
azul_dll::web::transpiler_remill::reloc_canonicalize (cognitive 89) dll/src/web/transpiler_remill.rs:7689— azul_dll::web::transpiler_remill::reloc_canonicalize has cognitive complexity 89 (threshold 15). Drivers by points: if/else 19 (58 pts), loops 6 (22 pts), boolean chains 9 (nesting depth added 55). 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.
azul_dll::web::transpiler_remill::inject_user_binary_data_segments (cognitive 83) dll/src/web/transpiler_remill.rs:4024— azul_dll::web::transpiler_remill::inject_user_binary_data_segments has cognitive complexity 83 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 8 (14 pts), boolean chains 5, match/switch 2 (nesting depth added 44). 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.
azul_dll::desktop::shell2::run::run (cognitive 79) dll/src/desktop/shell2/run.rs:620— azul_dll::desktop::shell2::run::run has cognitive complexity 79 (threshold 15). Drivers by points: loops 11 (35 pts), if/else 16 (28 pts), match/switch 5 (16 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.
azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses (cognitive 78) dll/src/web/transpiler_remill.rs:11061— azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses has cognitive complexity 78 (threshold 15). Drivers by points: if/else 29 (67 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::web::lift_audit::audit_wasm (cognitive 77) dll/src/web/lift_audit.rs:198— azul_dll::web::lift_audit::audit_wasm has cognitive complexity 77 (threshold 15). Drivers by points: if/else 14 (50 pts), loops 5 (18 pts), match/switch 2 (6 pts), boolean chains 3 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::web::symbol_table::read_pdb_function_symbols (cognitive 74) dll/src/web/symbol_table.rs:1538— azul_dll::web::symbol_table::read_pdb_function_symbols has cognitive complexity 74 (threshold 15). Drivers by points: if/else 19 (63 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 50). 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.
azul_dll::desktop::extra::gamepad::apple::poll (cognitive 72) dll/src/desktop/extra/gamepad/apple.rs:112— azul_dll::desktop::extra::gamepad::apple::poll has cognitive complexity 72 (threshold 15). Drivers by points: if/else 31 (67 pts), boolean chains 4, loops 1 (nesting depth added 36). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
azul_dll::desktop::tray::linux::menu_message (cognitive 69) dll/src/desktop/tray/linux.rs:778— azul_dll::desktop::tray::linux::menu_message has cognitive complexity 69 (threshold 15). Drivers by points: if/else 21 (50 pts), loops 3 (9 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 37). 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.
azul_dll::desktop::shell2::common::layout::apply_runtime_states_before_layout (cognitive 67) dll/src/desktop/shell2/common/layout.rs:1760— azul_dll::desktop::shell2::common::layout::apply_runtime_states_before_layout has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (60 pts), loops 2 (7 pts) (nesting depth added 46). 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.
azul_dll::web::server::handle_connection (cognitive 64) dll/src/web/server.rs:155— azul_dll::web::server::handle_connection has cognitive complexity 64 (threshold 15). Drivers by points: if/else 29 (51 pts), boolean chains 6, loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_dll::web::run_web (cognitive 64) dll/src/web/mod.rs:1007— azul_dll::web::run_web has cognitive complexity 64 (threshold 15). Drivers by points: loops 17 (31 pts), if/else 21 (30 pts), match/switch 2, boolean chains 1 (nesting depth added 23). 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.
azul_dll::desktop::shell2::common::transient::sync_parent (cognitive 62) dll/src/desktop/shell2/common/transient.rs:451— azul_dll::desktop::shell2::common::transient::sync_parent has cognitive complexity 62 (threshold 15). Drivers by points: if/else 22 (51 pts), match/switch 4 (5 pts), loops 4, boolean chains 2 (nesting depth added 30). 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.
MethodTooLong: BatchBuilder.add_prim_to_batch webrender/core/src/batch.rs:815— MethodTooLong — add_prim_to_batch runs 1836 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 1736 over it, 18.36× 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: PicturePrimitive.take_context webrender/core/src/picture.rs:5302— MethodTooLong — take_context runs 885 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 785 over it, 8.85× 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: MacOSWindow.new_with_options_internal dll/src/desktop/shell2/macos/mod.rs:4965— MethodTooLong — new_with_options_internal runs 629 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 529 over it, 6.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: X11Window.new_with_resources dll/src/desktop/shell2/linux/x11/mod.rs:3227— MethodTooLong — new_with_resources runs 610 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 510 over it, 6.10× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WaylandWindow.generate_frame_if_needed dll/src/desktop/shell2/linux/wayland/mod.rs:7011— MethodTooLong — generate_frame_if_needed runs 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 498 over it, 5.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: Profiler.new webrender/core/src/profiler.rs:401— MethodTooLong — new runs 595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 495 over it, 5.95× 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: WaylandWindow.new dll/src/desktop/shell2/linux/wayland/mod.rs:1972— MethodTooLong — new runs 585 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 485 over it, 5.85× 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: CpuBackend.render_frame dll/src/desktop/shell2/headless/mod.rs:549— MethodTooLong — render_frame runs 497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 397 over it, 4.97× 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: TaffyBridge.translate_style_to_taffy layout/src/solver3/taffy_bridge.rs:734— MethodTooLong — translate_style_to_taffy runs 471 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 371 over it, 4.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: HeadlessWindow.run dll/src/desktop/shell2/headless/mod.rs:2258— MethodTooLong — run runs 468 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 368 over it, 4.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.
MethodTooLong: Win32Window.new dll/src/desktop/shell2/windows/mod.rs:300— MethodTooLong — new runs 452 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 352 over it, 4.52× 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: SceneBuilder.wrap_prim_with_filters webrender/core/src/scene_building.rs:3599— MethodTooLong — wrap_prim_with_filters runs 451 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 351 over it, 4.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Filter.from webrender/core/src/internal_types.rs:995— MethodTooLong — from runs 440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 340 over it, 4.40× 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: Shaders.new webrender/core/src/renderer/shade.rs:630— MethodTooLong — new runs 437 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 337 over it, 4.37× 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: Win32Window.render_and_present dll/src/desktop/shell2/windows/mod.rs:1139— MethodTooLong — render_and_present runs 406 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 306 over it, 4.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TileCacheInstance.update_prim_dependencies webrender/core/src/picture.rs:3038— MethodTooLong — update_prim_dependencies runs 405 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 305 over it, 4.05× 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: MacOSWindow.render_and_present_in_draw_rect dll/src/desktop/shell2/macos/mod.rs:7700— MethodTooLong — render_and_present_in_draw_rect runs 390 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 290 over it, 3.90× 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: X11Window.render_and_present dll/src/desktop/shell2/linux/x11/mod.rs:6380— MethodTooLong — render_and_present runs 382 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 282 over it, 3.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: CssPropertyCache.build_compact_cache_with_inheritance_debug core/src/compact.rs:503— MethodTooLong — build_compact_cache_with_inheritance_debug runs 371 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 271 over it, 3.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: X11Window.handle_event dll/src/desktop/shell2/linux/x11/mod.rs:4836— MethodTooLong — handle_event runs 364 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 264 over it, 3.64× 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: FilterGraphOpKey.from webrender/core/src/prim_store/picture.rs:619— MethodTooLong — from runs 344 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 244 over it, 3.44× 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: SceneBuilder.build_item webrender/core/src/scene_building.rs:1332— MethodTooLong — build_item runs 320 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 220 over it, 3.20× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Device.new webrender/core/src/device/gl.rs:1440— MethodTooLong — new runs 301 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CssPropertyCache.build_compact_cache core/src/compact.rs:57— MethodTooLong — build_compact_cache runs 268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 168 over it, 2.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.
MethodTooLong: TileCacheInstance.pre_update webrender/core/src/picture.rs:2047— MethodTooLong — pre_update runs 263 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 163 over it, 2.63× 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.
azul_layout::solver3::fc::layout_bfc (cyclomatic 123) layout/src/solver3/fc.rs:1214— azul_layout::solver3::fc::layout_bfc has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::solver3::fc::translate_to_text3_constraints (cyclomatic 119) layout/src/solver3/fc.rs:4623— azul_layout::solver3::fc::translate_to_text3_constraints has cyclomatic complexity 119 (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.
azul_layout::event_determination::determine_all_events (cyclomatic 114) layout/src/event_determination.rs:599— azul_layout::event_determination::determine_all_events has cyclomatic complexity 114 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::scroll_timer::scroll_physics_timer_callback (cyclomatic 109) layout/src/scroll_timer.rs:334— azul_layout::scroll_timer::scroll_physics_timer_callback has cyclomatic complexity 109 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::solver3::layout_document (cyclomatic 96) layout/src/solver3/mod.rs:544— azul_layout::solver3::layout_document has cyclomatic complexity 96 (threshold 15). Of this number, 93 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::xml::parse_xml_to_fast_dom_with_css (cyclomatic 91) layout/src/xml/mod.rs:334— azul_layout::xml::parse_xml_to_fast_dom_with_css has cyclomatic complexity 91 (threshold 15). Of this number, 89 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::solver3::positioning::position_out_of_flow_elements (cyclomatic 88) layout/src/solver3/positioning.rs:160— azul_layout::solver3::positioning::position_out_of_flow_elements has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::cpurender::raster::render_single_item (cyclomatic 85) layout/src/cpurender/raster.rs:1830— azul_layout::cpurender::raster::render_single_item has cyclomatic complexity 85 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::text3::cache::position_one_line (cyclomatic 72) layout/src/text3/cache.rs:11839— azul_layout::text3::cache::position_one_line has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::solver3::sizing::calculate_used_size_for_node (cyclomatic 66) layout/src/solver3/sizing.rs:1730— azul_layout::solver3::sizing::calculate_used_size_for_node has cyclomatic complexity 66 (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.
azul_layout::text3::cache::perform_fragment_layout (cyclomatic 64) layout/src/text3/cache.rs:10761— azul_layout::text3::cache::perform_fragment_layout 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.
azul_layout::icu::plural_for (cyclomatic 61) layout/src/icu.rs:242— azul_layout::icu::plural_for 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.
azul_layout::solver3::cache::reconcile_recursive (cyclomatic 60) layout/src/solver3/cache.rs:1540— azul_layout::solver3::cache::reconcile_recursive 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.
azul_layout::solver3::fc::layout_ifc (cyclomatic 54) layout/src/solver3/fc.rs:3570— azul_layout::solver3::fc::layout_ifc 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.
azul_layout::solver3::fc::collect_and_measure_inline_content_impl (cyclomatic 52) layout/src/solver3/fc.rs:8628— azul_layout::solver3::fc::collect_and_measure_inline_content_impl 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.
azul_layout::solver3::display_list::paginate_pages_impl (cyclomatic 51) layout/src/solver3/display_list.rs:9684— azul_layout::solver3::display_list::paginate_pages_impl 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.
azul_layout::text3::cache::shape_visual_items (cyclomatic 48) layout/src/text3/cache.rs:9473— azul_layout::text3::cache::shape_visual_items 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.
azul_layout::default_actions::determine_keyboard_default_action_with_editing (cyclomatic 47) layout/src/default_actions.rs:95— azul_layout::default_actions::determine_keyboard_default_action_with_editing 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.
azul_layout::solver3::cache::calculate_layout_for_subtree_fragment (cyclomatic 45) layout/src/solver3/cache.rs:3020— azul_layout::solver3::cache::calculate_layout_for_subtree_fragment 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.
azul_layout::solver3::fc::position_table_cells (cyclomatic 44) layout/src/solver3/fc.rs:7936— azul_layout::solver3::fc::position_table_cells 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.
azul_layout::solver3::getters::get_style_properties_for_state (cyclomatic 41) layout/src/solver3/getters.rs:3042— azul_layout::solver3::getters::get_style_properties_for_state has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::cpurender::compositor::compute_display_list_damage_impl (cyclomatic 41) layout/src/cpurender/compositor.rs:2982— azul_layout::cpurender::compositor::compute_display_list_damage_impl has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_layout::solver3::display_list::compute_patch_move_summary (cyclomatic 40) layout/src/solver3/display_list.rs:3577— azul_layout::solver3::display_list::compute_patch_move_summary 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
azul_layout::xml::svg::render_node_clipmask_cpu::agg_translate_node (cyclomatic 39) layout/src/xml/svg.rs:1794— azul_layout::xml::svg::render_node_clipmask_cpu::agg_translate_node has cyclomatic complexity 39 (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.
azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes (cyclomatic 37) layout/src/widgets/node_graph.rs:3109— azul_layout::widgets::node_graph::nodegraph_drag_graph_or_nodes 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.
Duplicated block (9 lines × 2) core/src/diff.rs:741— core/src/diff.rs:741-750 | core/src/diff.rs:801-809 — both copies are in the same file, so extract the 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) core/src/dom.rs:2495— core/src/dom.rs:2495-2503 | core/src/dom.rs:3820-3828 — both copies are in the same file, so extract the 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) core/src/gl.rs:4168— core/src/gl.rs:4168-4176 | core/src/gl.rs:4185-4193 — both copies are in the same file, so extract the 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) core/src/resources.rs:1454— core/src/resources.rs:1454-1462 | core/src/resources.rs:3181-3189 — both copies are in the same file, so extract the 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) core/src/resources.rs:2603— core/src/resources.rs:2603-2611 | core/src/resources.rs:2722-2730 — both copies are in the same file, so extract the 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) core/src/xml.rs:4291— core/src/xml.rs:4291-4299 | core/src/xml.rs:4467-4475 — both copies are in the same file, so extract the 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) core/src/xml.rs:5439— core/src/xml.rs:5439-5447 | core/src/xml.rs:5470-5478 — both copies are in the same file, so extract the 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) core/src/xml.rs:8452— core/src/xml.rs:8452-8461 | core/src/xml.rs:8516-8524 — both copies are in the same file, so extract the 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) css/src/codegen/format.rs:215— css/src/codegen/format.rs:215-223 | css/src/codegen/format.rs:225-233 — both copies are in the same file, so extract the 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) css/src/props/basic/animation.rs:348— css/src/props/basic/animation.rs:348-356 | css/src/props/basic/animation.rs:371-379 — both copies are in the same file, so extract the 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) css/src/shape_parser.rs:106— css/src/shape_parser.rs:106-114 | css/src/shape_parser.rs:134-142 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/geolocation/ios.rs:128— dll/src/desktop/extra/geolocation/ios.rs:128-136 | dll/src/desktop/extra/geolocation/macos.rs:122-130 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) dll/src/desktop/extra/geolocation/linux.rs:49— dll/src/desktop/extra/geolocation/linux.rs:49-57 | dll/src/desktop/extra/geolocation/windows.rs:68-76 — 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) dll/src/desktop/extra/pdf/mod.rs:635— dll/src/desktop/extra/pdf/mod.rs:635-643 | layout/src/window.rs:1804-1812 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) dll/src/desktop/shell2/android/mod.rs:586— dll/src/desktop/shell2/android/mod.rs:586-594 | dll/src/desktop/shell2/ios/mod.rs:2034-2042 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) dll/src/desktop/shell2/common/event.rs:8050— dll/src/desktop/shell2/common/event.rs:8050-8058 | dll/src/desktop/shell2/common/event.rs:8119-8127 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/ios/mod.rs:941— dll/src/desktop/shell2/ios/mod.rs:941-949 | dll/src/desktop/shell2/ios/mod.rs:967-975 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/events.rs:1697— dll/src/desktop/shell2/linux/wayland/events.rs:1697-1705 | dll/src/desktop/shell2/linux/wayland/events.rs:1715-1723 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2066— dll/src/desktop/shell2/linux/wayland/mod.rs:2066-2074 | dll/src/desktop/shell2/linux/x11/mod.rs:3909-3917 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5161— dll/src/desktop/shell2/linux/wayland/mod.rs:5161-5169 | dll/src/desktop/shell2/linux/wayland/mod.rs:5237-5246 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/x11/events.rs:765— dll/src/desktop/shell2/linux/x11/events.rs:765-773 | dll/src/desktop/shell2/macos/events.rs:394-402 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/events.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:946— dll/src/desktop/shell2/linux/x11/mod.rs:946-954 | dll/src/desktop/shell2/linux/x11/mod.rs:999-1007 — both copies are in the same file, so extract the 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) dll/src/web/mod.rs:537— dll/src/web/mod.rs:537-545 | dll/src/web/symbol_table.rs:1241-1249 — 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) dll/src/desktop/compositor2.rs:1737— dll/src/desktop/compositor2.rs:1737-1745 | dll/src/desktop/compositor2.rs:1926-1934 — both copies are in the same file, so extract the 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) doc/src/autofix/diff.rs:946— doc/src/autofix/diff.rs:946-954 | doc/src/autofix/diff.rs:958-966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: CssProperty css/src/props/property.rs:662— TooManyMethods — 426 methods. The bar is 30 methods; this is 396 over it, 14.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CallbackInfo layout/src/callbacks.rs:1290— TooManyMethods — 384 methods. The bar is 30 methods; this is 354 over it, 12.80× 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: LayoutWindow layout/src/window.rs:1184— TooManyMethods — 322 methods. The bar is 30 methods; this is 292 over it, 10.73× 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: Dom core/src/dom.rs:4237— TooManyMethods — 247 methods. The bar is 30 methods; this is 217 over it, 8.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GlContextPtr core/src/gl.rs:985— TooManyMethods — 229 methods. The bar is 30 methods; this is 199 over it, 7.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: ColorU css/src/props/basic/color.rs:35— TooManyMethods — 140 methods. The bar is 30 methods; this is 110 over it, 4.67× 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: Device webrender/core/src/device/gl.rs:1076— TooManyMethods — 133 methods. The bar is 30 methods; this is 103 over it, 4.43× 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: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544— TooManyMethods — 132 methods. The bar is 30 methods; this is 102 over it, 4.40× 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: NodeData core/src/dom.rs:1689— TooManyMethods — 113 methods. The bar is 30 methods; this is 83 over it, 3.77× 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: CompactLayoutCache css/src/compact_cache.rs:1645— TooManyMethods — 108 methods. The bar is 30 methods; this is 78 over it, 3.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: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009— TooManyMethods — 99 methods, declared across 2 files: macos/mod.rs (73), macos/events.rs (26). The bar is 30 methods; this is 69 over it, 3.30× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GestureAndDragManager layout/src/managers/gesture.rs:720— TooManyMethods — 99 methods. The bar is 30 methods; this is 69 over it, 3.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: Renderer webrender/core/src/renderer/mod.rs:761— TooManyMethods — 86 methods, declared across 3 files: renderer/mod.rs (77), src/screen_capture.rs (6), renderer/gpu_cache.rs (3). The bar is 30 methods; this is 56 over it, 2.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593— TooManyMethods — 84 methods, declared across 2 files: x11/mod.rs (64), x11/events.rs (20). The bar is 30 methods; this is 54 over it, 2.80× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CssPropertyCache core/src/prop_cache.rs:1017— TooManyMethods — 75 methods, declared across 2 files: src/prop_cache.rs (72), src/compact.rs (3). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DisplayListBuilder webrender/api/src/display_list.rs:1036— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Win32Window dll/src/desktop/shell2/windows/mod.rs:147— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.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: ResourceCache webrender/core/src/resource_cache.rs:442— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FilePath layout/src/file.rs:685— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: TimerCallbackInfo layout/src/timer.rs:353— TooManyMethods — 52 methods. The bar is 30 methods; this is 22 over it, 1.73× 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: SceneBuilder webrender/core/src/scene_building.rs:434— TooManyMethods — 50 methods, declared across 3 files: src/scene_building.rs (48), src/border.rs (1), src/box_shadow.rs (1). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RibbonStyle layout/src/widgets/ribbon.rs:1643— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TextEditManager layout/src/managers/text_edit.rs:436— TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VirtualKeyCodeVec core/src/window.rs:656— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ScanCodeVec core/src/window.rs:679— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (8 lines × 2) core/src/gl.rs:3504— core/src/gl.rs:3504-3511 | core/src/gl.rs:3711-3718 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/src/resources.rs:1154— core/src/resources.rs:1154-1161 | core/src/resources.rs:1188-1195 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) css/src/props/style/transform.rs:957— css/src/props/style/transform.rs:957-964 | css/src/props/style/transform.rs:994-1001 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/extra/capability.rs:224— dll/src/desktop/extra/capability.rs:224-231 | dll/src/desktop/extra/capability.rs:244-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/extra/pdf/mod.rs:188— dll/src/desktop/extra/pdf/mod.rs:188-195 | dll/src/desktop/extra/pdf/mod.rs:238-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/android/mod.rs:366— dll/src/desktop/shell2/android/mod.rs:366-373 | dll/src/desktop/shell2/android/mod.rs:394-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/android/mod.rs:1188— dll/src/desktop/shell2/android/mod.rs:1188-1195 | dll/src/desktop/shell2/android/mod.rs:1222-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/android/mod.rs:2717— dll/src/desktop/shell2/android/mod.rs:2717-2724 | dll/src/desktop/shell2/android/mod.rs:3015-3022 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/common/event.rs:522— dll/src/desktop/shell2/common/event.rs:522-529 | layout/src/window.rs:20057-20064 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/common/event.rs:6321— dll/src/desktop/shell2/common/event.rs:6321-6328 | dll/src/desktop/shell2/common/event.rs:6334-6341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/common/event.rs:6742— dll/src/desktop/shell2/common/event.rs:6742-6749 | dll/src/desktop/shell2/common/event.rs:6929-6936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/ios/text_input.rs:730— dll/src/desktop/shell2/ios/text_input.rs:730-737 | dll/src/desktop/shell2/ios/text_input.rs:762-769 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1673— dll/src/desktop/shell2/linux/wayland/mod.rs:1673-1680 | dll/src/desktop/shell2/linux/wayland/mod.rs:10146-10153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:7969— dll/src/desktop/shell2/linux/wayland/mod.rs:7969-7976 | dll/src/desktop/shell2/linux/wayland/mod.rs:7986-7993 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10576— dll/src/desktop/shell2/linux/wayland/mod.rs:10576-10583 | dll/src/desktop/shell2/linux/wayland/mod.rs:10608-10615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:4258— dll/src/desktop/shell2/linux/x11/mod.rs:4258-4265 | dll/src/desktop/shell2/windows/mod.rs:7677-7684 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:4271— dll/src/desktop/shell2/linux/x11/mod.rs:4271-4278 | dll/src/desktop/shell2/windows/mod.rs:7689-7696 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:8360— dll/src/desktop/shell2/linux/x11/mod.rs:8360-8367 | dll/src/desktop/shell2/linux/x11/mod.rs:8389-8396 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/macos/mod.rs:560— dll/src/desktop/shell2/macos/mod.rs:560-567 | dll/src/desktop/shell2/macos/mod.rs:597-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/macos/mod.rs:2597— dll/src/desktop/shell2/macos/mod.rs:2597-2604 | dll/src/desktop/shell2/macos/mod.rs:2620-2627 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/shell2/windows/mod.rs:3618— dll/src/desktop/shell2/windows/mod.rs:3618-3625 | dll/src/desktop/shell2/windows/mod.rs:3661-3668 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/web/server.rs:872— dll/src/web/server.rs:872-879 | dll/src/web/server.rs:888-895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/web/symbol_table.rs:2694— dll/src/web/symbol_table.rs:2694-2701 | dll/src/web/symbol_table.rs:2786-2802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/web/transpiler_remill.rs:1434— dll/src/web/transpiler_remill.rs:1434-1441 | dll/src/web/transpiler_remill.rs:6748-6755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) dll/src/desktop/extra/permission/ios.rs:40— dll/src/desktop/extra/permission/ios.rs:40-50 | dll/src/desktop/extra/permission/macos.rs:97-104 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) core/src/path_parser.rs:315— core/src/path_parser.rs:315-321 | core/src/path_parser.rs:363-369 — both copies are in the same file, so extract the 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) core/src/prop_cache.rs:3258— core/src/prop_cache.rs:3258-3264 | core/src/prop_cache.rs:3280-3286 — both copies are in the same file, so extract the 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) css/src/props/basic/time.rs:242— css/src/props/basic/time.rs:242-248 | css/src/props/basic/time.rs:252-258 — both copies are in the same file, so extract the 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) css/src/system.rs:2433— css/src/system.rs:2433-2439 | css/src/system.rs:2484-2490 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/geolocation/ios.rs:211— dll/src/desktop/extra/geolocation/ios.rs:211-217 | dll/src/desktop/extra/geolocation/macos.rs:205-211 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) dll/src/desktop/extra/sqlite/mod.rs:1491— dll/src/desktop/extra/sqlite/mod.rs:1491-1497 | layout/src/journal.rs:143-149 — 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) dll/src/desktop/shell2/android/clipboard.rs:181— dll/src/desktop/shell2/android/clipboard.rs:181-187 | dll/src/desktop/shell2/android/mod.rs:2521-2527 — 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) dll/src/desktop/shell2/ios/text_input.rs:528— dll/src/desktop/shell2/ios/text_input.rs:528-534 | dll/src/desktop/shell2/ios/text_input.rs:616-622 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:851— dll/src/desktop/shell2/linux/system_style.rs:851-857 | dll/src/desktop/shell2/macos/system_style.rs:566-572 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1669— dll/src/desktop/shell2/linux/wayland/mod.rs:1669-1675 | dll/src/desktop/shell2/linux/wayland/mod.rs:3752-3758 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6042— dll/src/desktop/shell2/linux/wayland/mod.rs:6042-6048 | dll/src/desktop/shell2/linux/wayland/mod.rs:6112-6118 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:68— dll/src/desktop/shell2/linux/wayland/screencopy.rs:68-74 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:317-323 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/x11/mod.rs:4511— dll/src/desktop/shell2/linux/x11/mod.rs:4511-4517 | dll/src/desktop/shell2/linux/x11/mod.rs:4657-4663 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/windows/mod.rs:1536— dll/src/desktop/shell2/windows/mod.rs:1536-1542 | dll/src/desktop/shell2/windows/mod.rs:1769-1775 — both copies are in the same file, so extract the 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) dll/src/desktop/wr_translate2.rs:1828— dll/src/desktop/wr_translate2.rs:1828-1834 | dll/src/desktop/wr_translate2.rs:1869-1875 — both copies are in the same file, so extract the 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) dll/src/web/symbol_table.rs:1667— dll/src/web/symbol_table.rs:1667-1673 | dll/src/web/symbol_table.rs:1976-1982 — both copies are in the same file, so extract the 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) dll/src/web/transpiler_remill.rs:8469— dll/src/web/transpiler_remill.rs:8469-8475 | dll/src/web/transpiler_remill.rs:8480-8486 — both copies are in the same file, so extract the 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) dll/src/web/transpiler_remill.rs:11795— dll/src/web/transpiler_remill.rs:11795-11801 | dll/src/web/transpiler_remill.rs:11836-11842 — both copies are in the same file, so extract the 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) dll/src/desktop/compositor2.rs:137— dll/src/desktop/compositor2.rs:137-143 | dll/src/desktop/compositor2.rs:924-930 — both copies are in the same file, so extract the 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) doc/src/autofix/diff.rs:640— doc/src/autofix/diff.rs:640-647 | doc/src/autofix/diff.rs:2260-2266 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_crystal/model.rs:547— doc/src/codegen/v2/lang_crystal/model.rs:547-553 | doc/src/codegen/v2/lang_d/model.rs:853-859 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_crystal/wrappers.rs:1163— doc/src/codegen/v2/lang_crystal/wrappers.rs:1163-1169 | doc/src/codegen/v2/lang_swift/wrappers.rs:1890-1897 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_d/model.rs:278— doc/src/codegen/v2/lang_d/model.rs:278-284 | doc/src/codegen/v2/lang_swift/model.rs:286-292 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_d/model.rs:605— doc/src/codegen/v2/lang_d/model.rs:605-611 | doc/src/codegen/v2/lang_swift/model.rs:621-627 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:2028— doc/src/codegen/v2/lang_d/wrappers.rs:2028-2034 | doc/src/codegen/v2/lang_swift/wrappers.rs:1972-1978 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) core/src/prop_cache.rs:614— core/src/prop_cache.rs:614-619 | core/src/prop_cache.rs:653-658 — both copies are in the same file, so extract the 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) core/src/prop_cache.rs:683— core/src/prop_cache.rs:683-688 | core/src/prop_cache.rs:741-746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/src/xml.rs:8442— core/src/xml.rs:8442-8447 | core/src/xml.rs:8509-8514 — both copies are in the same file, so extract the 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) css/src/system.rs:2584— css/src/system.rs:2584-2589 | css/src/system.rs:2684-2689 — both copies are in the same file, so extract the 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) css/src/system.rs:2744— css/src/system.rs:2744-2749 | css/src/system.rs:2820-2825 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/iroh/mod.rs:63— dll/src/desktop/extra/iroh/mod.rs:63-68 | dll/src/desktop/extra/iroh/mod.rs:293-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) dll/src/desktop/extra/video_codec/mod.rs:714— dll/src/desktop/extra/video_codec/mod.rs:714-719 | dll/src/desktop/extra/video_codec/mod.rs:738-743 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/android/mod.rs:1682— dll/src/desktop/shell2/android/mod.rs:1682-1687 | dll/src/desktop/shell2/ios/mod.rs:673-678 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) dll/src/desktop/shell2/headless/mod.rs:2413— dll/src/desktop/shell2/headless/mod.rs:2413-2420 | dll/src/desktop/shell2/headless/mod.rs:2433-2438 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/ios/text_input.rs:204— dll/src/desktop/shell2/ios/text_input.rs:204-209 | dll/src/desktop/shell2/ios/text_input.rs:225-230 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:386— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:386-391 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:463-468 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:1350— dll/src/desktop/shell2/linux/system_style.rs:1350-1355 | dll/src/desktop/shell2/linux/system_style.rs:1495-1500 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:1358— dll/src/desktop/shell2/linux/system_style.rs:1358-1363 | dll/src/desktop/shell2/linux/system_style.rs:1504-1509 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:1367— dll/src/desktop/shell2/linux/system_style.rs:1367-1372 | dll/src/desktop/shell2/linux/system_style.rs:1513-1518 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:1609— dll/src/desktop/shell2/linux/wayland/mod.rs:1609-1614 | dll/src/desktop/shell2/linux/x11/mod.rs:7870-7875 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) dll/src/desktop/tray/linux.rs:511— dll/src/desktop/tray/linux.rs:511-516 | dll/src/desktop/tray/linux.rs:940-945 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_icons.rs:195— dll/src/desktop/shell2/linux/system_icons.rs:195-200 | dll/src/desktop/shell2/linux/system_icons.rs:220-225 — both copies are in the same file, so extract the 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) doc/src/api.rs:2603— doc/src/api.rs:2603-2609 | doc/src/api.rs:2746-2751 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/ir_builder.rs:287— doc/src/codegen/v2/ir_builder.rs:287-293 | doc/src/codegen/v2/ir_builder.rs:315-320 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/ir_builder.rs:1042— doc/src/codegen/v2/ir_builder.rs:1042-1047 | doc/src/codegen/v2/ir_builder.rs:1152-1157 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_c.rs:1032— doc/src/codegen/v2/lang_c.rs:1032-1037 | doc/src/codegen/v2/lang_zig/c_decls.rs:468-473 — 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) doc/src/codegen/v2/lang_c.rs:1103— doc/src/codegen/v2/lang_c.rs:1103-1108 | doc/src/codegen/v2/lang_zig/c_decls.rs:524-529 — 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) doc/src/codegen/v2/lang_d/wrappers.rs:151— doc/src/codegen/v2/lang_d/wrappers.rs:151-156 | doc/src/codegen/v2/lang_swift/wrappers.rs:113-118 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:619— doc/src/codegen/v2/lang_d/wrappers.rs:619-624 | doc/src/codegen/v2/lang_swift/wrappers.rs:452-457 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1994— doc/src/codegen/v2/lang_d/wrappers.rs:1994-1999 | doc/src/codegen/v2/lang_d/wrappers.rs:2022-2027 — both copies are in the same file, so extract the 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) core/src/compact.rs:1349— core/src/compact.rs:1349-1359 | core/src/compact.rs:1369-1379 — both copies are in the same file, so extract the 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) core/src/resources.rs:2793— core/src/resources.rs:2793-2803 | core/src/resources.rs:2944-2954 — both copies are in the same file, so extract the 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) core/src/svg.rs:661— core/src/svg.rs:661-671 | core/src/svg.rs:674-684 — both copies are in the same file, so extract the 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) core/src/xml.rs:436— core/src/xml.rs:436-446 | core/src/xml.rs:561-571 — both copies are in the same file, so extract the 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) css/src/codegen/format.rs:398— css/src/codegen/format.rs:398-408 | css/src/codegen/format.rs:968-978 — both copies are in the same file, so extract the 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) css/src/system.rs:883— css/src/system.rs:883-893 | css/src/system.rs:919-929 — both copies are in the same file, so extract the 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) css/src/system.rs:2603— css/src/system.rs:2603-2613 | css/src/system.rs:2702-2712 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/common/event.rs:5661— dll/src/desktop/shell2/common/event.rs:5661-5672 | dll/src/desktop/shell2/common/event.rs:5681-5691 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:861— dll/src/desktop/shell2/linux/system_style.rs:861-871 | dll/src/desktop/shell2/windows/system_style.rs:399-409 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/wayland/dlopen.rs:1124— dll/src/desktop/shell2/linux/wayland/dlopen.rs:1124-1135 | dll/src/desktop/shell2/linux/wayland/dlopen.rs:1147-1157 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/events.rs:4136— dll/src/desktop/shell2/linux/wayland/events.rs:4136-4146 | dll/src/desktop/shell2/linux/wayland/events.rs:4168-4178 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:505— dll/src/desktop/shell2/linux/wayland/mod.rs:505-515 | dll/src/desktop/shell2/linux/wayland/mod.rs:5598-5608 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2767— dll/src/desktop/shell2/linux/wayland/mod.rs:2767-2777 | dll/src/desktop/shell2/linux/x11/mod.rs:4127-4137 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3137— dll/src/desktop/shell2/linux/wayland/mod.rs:3137-3147 | dll/src/desktop/shell2/linux/x11/mod.rs:4643-4653 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3221— dll/src/desktop/shell2/linux/wayland/mod.rs:3221-3231 | dll/src/desktop/shell2/linux/x11/mod.rs:4668-4678 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5241— dll/src/desktop/shell2/linux/wayland/mod.rs:5241-5255 | dll/src/desktop/shell2/linux/x11/mod.rs:4819-4829 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6333— dll/src/desktop/shell2/linux/wayland/mod.rs:6333-6343 | dll/src/desktop/shell2/linux/x11/events.rs:1464-1474 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/x11/accessibility.rs:47— dll/src/desktop/shell2/linux/x11/accessibility.rs:47-57 | dll/src/desktop/shell2/windows/accessibility.rs:57-67 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:5642— dll/src/desktop/shell2/linux/x11/mod.rs:5642-5652 | dll/src/desktop/shell2/linux/x11/mod.rs:7932-7942 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/macos/mod.rs:2712— dll/src/desktop/shell2/macos/mod.rs:2712-2722 | dll/src/desktop/shell2/macos/mod.rs:2814-2824 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/windows/mod.rs:5142— dll/src/desktop/shell2/windows/mod.rs:5142-5152 | dll/src/desktop/shell2/windows/mod.rs:5192-5202 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/natural_scroll.rs:72— dll/src/desktop/extra/natural_scroll.rs:72-82 | dll/src/desktop/shell2/windows/subpixel.rs:57-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) dll/src/desktop/compositor2.rs:1716— dll/src/desktop/compositor2.rs:1716-1726 | dll/src/desktop/compositor2.rs:1905-1915 — both copies are in the same file, so extract the 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) doc/src/autofix/diff.rs:2567— doc/src/autofix/diff.rs:2567-2577 | doc/src/autofix/diff.rs:2653-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.
Duplicated block (11 lines × 2) doc/src/autofix/patch_format.rs:987— doc/src/autofix/patch_format.rs:987-997 | doc/src/autofix/patch_format.rs:1011-1021 — both copies are in the same file, so extract the 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) core/src/json.rs:463— core/src/json.rs:463-467 | core/src/json.rs:479-483 — both copies are in the same file, so extract the 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) dll/src/desktop/display.rs:500— dll/src/desktop/display.rs:500-504 | dll/src/desktop/display.rs:506-516 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/video_codec/demux.rs:137— dll/src/desktop/extra/video_codec/demux.rs:137-141 | dll/src/desktop/extra/video_codec/videotoolbox.rs:524-530 — 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) dll/src/desktop/extra/video_codec/videotoolbox.rs:671— dll/src/desktop/extra/video_codec/videotoolbox.rs:671-675 | dll/src/desktop/extra/video_codec/videotoolbox.rs:794-798 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/android/mod.rs:212— dll/src/desktop/shell2/android/mod.rs:212-216 | dll/src/desktop/shell2/ios/mod.rs:1611-1615 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) dll/src/desktop/shell2/headless/mod.rs:2396— dll/src/desktop/shell2/headless/mod.rs:2396-2400 | dll/src/desktop/shell2/headless/mod.rs:2413-2417 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:3007— dll/src/desktop/shell2/linux/system_style.rs:3007-3011 | dll/src/desktop/shell2/linux/system_style.rs:3017-3021 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:2074— dll/src/desktop/shell2/linux/wayland/mod.rs:2074-2078 | dll/src/desktop/shell2/linux/wayland/mod.rs:9501-9505 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/biometric/android.rs:38— dll/src/desktop/extra/biometric/android.rs:38-44 | dll/src/desktop/extra/keyring/android.rs:32-36 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) doc/src/api.rs:1878— doc/src/api.rs:1878-1885 | doc/src/api.rs:1984-1988 — both copies are in the same file, so extract the 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) doc/src/autofix/type_index.rs:2019— doc/src/autofix/type_index.rs:2019-2023 | doc/src/autofix/type_index.rs:2188-2192 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:1073— doc/src/codegen/v2/lang_crystal/wrappers.rs:1073-1077 | doc/src/codegen/v2/lang_crystal/wrappers.rs:1627-1631 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_d/wrappers.rs:646— doc/src/codegen/v2/lang_d/wrappers.rs:646-650 | doc/src/codegen/v2/lang_swift/wrappers.rs:479-483 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1787— doc/src/codegen/v2/lang_d/wrappers.rs:1787-1791 | doc/src/codegen/v2/lang_swift/wrappers.rs:1763-1767 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:2537— doc/src/codegen/v2/lang_d/wrappers.rs:2537-2541 | doc/src/codegen/v2/lang_swift/wrappers.rs:2585-2589 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:2696— doc/src/codegen/v2/lang_d/wrappers.rs:2696-2700 | doc/src/codegen/v2/lang_d/wrappers.rs:2710-2715 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_ocaml/wrappers.rs:110— doc/src/codegen/v2/lang_ocaml/wrappers.rs:110-114 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:167-171 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_swift/wrappers.rs:2746— doc/src/codegen/v2/lang_swift/wrappers.rs:2746-2750 | doc/src/codegen/v2/lang_swift/wrappers.rs:2760-2764 — both copies are in the same file, so extract the 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) doc/src/lint_examples.rs:498— doc/src/lint_examples.rs:498-502 | doc/src/lint_examples.rs:551-555 — both copies are in the same file, so extract the 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) doc/src/reftest/autoreview.rs:1462— doc/src/reftest/autoreview.rs:1462-1466 | doc/src/reftest/autoreview.rs:1991-1995 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_ada/types.rs:415— doc/src/codegen/v2/lang_ada/types.rs:415-419 | doc/src/codegen/v2/lang_ada/types.rs:454-458 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_ruby/types.rs:214— doc/src/codegen/v2/lang_ruby/types.rs:214-218 | doc/src/codegen/v2/lang_ruby/types.rs:358-362 — both copies are in the same file, so extract the 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) doc/src/autofix/debug.rs:763— doc/src/autofix/debug.rs:763-767 | doc/src/autofix/debug.rs:1068-1072 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_freebasic/types.rs:328— doc/src/codegen/v2/lang_freebasic/types.rs:328-332 | doc/src/codegen/v2/lang_vb6/types.rs:320-324 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 2) layout/src/cpurender/compositor.rs:568— layout/src/cpurender/compositor.rs:568-572 | layout/src/cpurender/raster.rs:2671-2675 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
azul_dll::desktop::shell2::windows::window_proc (cyclomatic 205) dll/src/desktop/shell2/windows/mod.rs:4025— azul_dll::desktop::shell2::windows::window_proc has cyclomatic complexity 205 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_dll::desktop::compositor2::translate_displaylist_to_wr (cyclomatic 107) dll/src/desktop/compositor2.rs:174— azul_dll::desktop::compositor2::translate_displaylist_to_wr 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.
azul_dll::web::symbol_table::classify_for_name (cyclomatic 94) dll/src/web/symbol_table.rs:2437— azul_dll::web::symbol_table::classify_for_name has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_dll::desktop::shell2::common::layout::regenerate_layout (cyclomatic 79) dll/src/desktop/shell2/common/layout.rs:236— azul_dll::desktop::shell2::common::layout::regenerate_layout has cyclomatic complexity 79 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_dll::desktop::shell2::android::drain_input (cyclomatic 68) dll/src/desktop/shell2/android/mod.rs:1262— azul_dll::desktop::shell2::android::drain_input has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_dll::desktop::shell2::linux::x11::init_xinput2 (cyclomatic 60) dll/src/desktop/shell2/linux/x11/mod.rs:866— azul_dll::desktop::shell2::linux::x11::init_xinput2 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.
azul_dll::desktop::shell2::run::run (cyclomatic 53) dll/src/desktop/shell2/run.rs:1963— azul_dll::desktop::shell2::run::run 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.
azul_dll::desktop::shell2::macos::system_style::discover (cyclomatic 50) dll/src/desktop/shell2/macos/system_style.rs:259— azul_dll::desktop::shell2::macos::system_style::discover 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.
azul_dll::desktop::shell2::linux::system_style::discover_kde_style (cyclomatic 49) dll/src/desktop/shell2/linux/system_style.rs:1642— azul_dll::desktop::shell2::linux::system_style::discover_kde_style has cyclomatic complexity 49 (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.
azul_dll::web::server::handle_connection (cyclomatic 44) dll/src/web/server.rs:155— azul_dll::web::server::handle_connection 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.
azul_dll::desktop::extra::video_codec::stream::decode_stream (cyclomatic 44) dll/src/desktop/extra/video_codec/stream.rs:96— azul_dll::desktop::extra::video_codec::stream::decode_stream 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.
azul_dll::web::transpiler_remill::collect_synth_data_pages (cyclomatic 44) dll/src/web/transpiler_remill.rs:4742— azul_dll::web::transpiler_remill::collect_synth_data_pages 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.
azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges (cyclomatic 44) dll/src/web/symbol_table.rs:3247— azul_dll::web::symbol_table::compute_hashbrown_empty_group_ranges 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.
azul_dll::desktop::shell2::ios::handle_touch (cyclomatic 44) dll/src/desktop/shell2/ios/mod.rs:331— azul_dll::desktop::shell2::ios::handle_touch 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.
azul_dll::desktop::shell2::linux::x11::handle_xi_device_event (cyclomatic 41) dll/src/desktop/shell2/linux/x11/mod.rs:2048— azul_dll::desktop::shell2::linux::x11::handle_xi_device_event has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_dll::desktop::tray::linux::menu_message (cyclomatic 40) dll/src/desktop/tray/linux.rs:778— azul_dll::desktop::tray::linux::menu_message 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.
azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses (cyclomatic 40) dll/src/web/transpiler_remill.rs:11061— azul_dll::web::transpiler_remill::scan_arm64_adrp_accesses 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.
azul_dll::web::transpiler_remill::inject_user_binary_data_segments (cyclomatic 39) dll/src/web/transpiler_remill.rs:4024— azul_dll::web::transpiler_remill::inject_user_binary_data_segments 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.
azul_dll::web::run_web (cyclomatic 37) dll/src/web/mod.rs:1007— azul_dll::web::run_web has cyclomatic 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. This is NOT this file's highest cyclomatic complexity: azul_dll::web::eventloop_symbol_addr (cyclomatic 38) 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.
azul_dll::desktop::native_screenshot::take_native_screenshot_xlib_bytes (cyclomatic 37) dll/src/desktop/native_screenshot.rs:770— azul_dll::desktop::native_screenshot::take_native_screenshot_xlib_bytes 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.
azul_dll::desktop::shell2::linux::system_style::discover_gnome_style (cyclomatic 35) dll/src/desktop/shell2/linux/system_style.rs:1475— azul_dll::desktop::shell2::linux::system_style::discover_gnome_style has cyclomatic complexity 35 (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.
azul_dll::web::transpiler_remill::reloc_canonicalize (cyclomatic 35) dll/src/web/transpiler_remill.rs:7689— azul_dll::web::transpiler_remill::reloc_canonicalize 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.
azul_dll::desktop::shell2::run::run (cyclomatic 35) dll/src/desktop/shell2/run.rs:1477— azul_dll::desktop::shell2::run::run 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.
azul_dll::web::transpiler_remill::parse_reg_store (cyclomatic 34) dll/src/web/transpiler_remill.rs:9133— azul_dll::web::transpiler_remill::parse_reg_store has cyclomatic complexity 34 (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.
azul_dll::desktop::shell2::android::android_main (cyclomatic 33) dll/src/desktop/shell2/android/mod.rs:670— azul_dll::desktop::shell2::android::android_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.
Duplicated block (10 lines × 2) core/src/diff.rs:689— core/src/diff.rs:689-698 | core/src/diff.rs:756-765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/src/path_parser.rs:344— core/src/path_parser.rs:344-353 | core/src/path_parser.rs:370-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/src/resources.rs:2778— core/src/resources.rs:2778-2787 | core/src/resources.rs:2929-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) css/src/props/basic/color.rs:1819— css/src/props/basic/color.rs:1819-1828 | css/src/props/basic/color.rs:1859-1868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) css/src/props/property.rs:4462— css/src/props/property.rs:4462-4471 | css/src/props/property.rs:4477-4486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/extra/audio/alsa.rs:65— dll/src/desktop/extra/audio/alsa.rs:65-74 | dll/src/desktop/extra/audio/alsa.rs:159-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:161— dll/src/desktop/extra/geolocation/ios.rs:161-170 | dll/src/desktop/extra/geolocation/macos.rs:155-164 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) dll/src/desktop/extra/sqlite/mod.rs:535— dll/src/desktop/extra/sqlite/mod.rs:535-544 | dll/src/desktop/extra/sqlite/mod.rs:572-581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/common/event.rs:6581— dll/src/desktop/shell2/common/event.rs:6581-6590 | dll/src/desktop/shell2/common/event.rs:11164-11173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/ios/mod.rs:814— dll/src/desktop/shell2/ios/mod.rs:814-823 | dll/src/desktop/shell2/macos/mod.rs:5994-6003 — `dll/src/desktop/shell2/ios/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1578— dll/src/desktop/shell2/linux/wayland/mod.rs:1578-1587 | dll/src/desktop/shell2/linux/x11/mod.rs:7839-7848 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4688— dll/src/desktop/shell2/linux/wayland/mod.rs:4688-4697 | dll/src/desktop/shell2/linux/wayland/mod.rs:4737-4746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:9146— dll/src/desktop/shell2/linux/wayland/mod.rs:9146-9155 | dll/src/desktop/shell2/linux/x11/mod.rs:8564-8573 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6539— dll/src/desktop/shell2/linux/x11/mod.rs:6539-6548 | dll/src/desktop/shell2/windows/mod.rs:1159-1168 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) dll/src/web/symbol_table.rs:1688— dll/src/web/symbol_table.rs:1688-1697 | dll/src/web/symbol_table.rs:1999-2008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) dll/src/desktop/extra/permission/ios.rs:69— dll/src/desktop/extra/permission/ios.rs:69-78 | dll/src/desktop/extra/permission/macos.rs:168-177 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) dll/src/desktop/compositor2.rs:318— dll/src/desktop/compositor2.rs:318-327 | dll/src/desktop/compositor2.rs:1297-1306 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/api.rs:2089— doc/src/api.rs:2089-2099 | doc/src/api.rs:2366-2375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/autofix/type_index.rs:2214— doc/src/autofix/type_index.rs:2214-2223 | doc/src/autofix/type_index.rs:2232-2241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/autofix/workspace.rs:1547— doc/src/autofix/workspace.rs:1547-1556 | doc/src/autofix/workspace.rs:1592-1601 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/codegen/v2/lang_c.rs:674— doc/src/codegen/v2/lang_c.rs:674-683 | doc/src/codegen/v2/lang_c.rs:719-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/codegen/v2/lang_c.rs:1433— doc/src/codegen/v2/lang_c.rs:1433-1442 | doc/src/codegen/v2/lang_c.rs:1453-1462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/codegen/v2/lang_cpp/cpp20.rs:1012— doc/src/codegen/v2/lang_cpp/cpp20.rs:1012-1021 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1039-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) doc/src/codegen/v2/lang_crystal/model.rs:214— doc/src/codegen/v2/lang_crystal/model.rs:214-223 | doc/src/codegen/v2/lang_swift/model.rs:257-266 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 85 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1747— doc/src/codegen/v2/lang_d/wrappers.rs:1747-1756 | doc/src/codegen/v2/lang_swift/wrappers.rs:1723-1732 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 2) core/src/callbacks.rs:551— core/src/callbacks.rs:551-562 | core/src/callbacks.rs:1334-1345 — both copies are in the same file, so extract the 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) core/src/compact.rs:688— core/src/compact.rs:688-699 | core/src/compact.rs:1544-1555 — both copies are in the same file, so extract the 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) core/src/gl.rs:3118— core/src/gl.rs:3118-3129 | layout/src/xml/svg.rs:1622-1633 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) core/src/path_parser.rs:294— core/src/path_parser.rs:294-305 | core/src/path_parser.rs:323-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.
Duplicated block (12 lines × 2) core/src/resources.rs:1724— core/src/resources.rs:1724-1735 | core/src/resources.rs:3216-3227 — both copies are in the same file, so extract the 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) core/src/resources.rs:2940— core/src/resources.rs:2940-2951 | core/src/resources.rs:2956-2967 — both copies are in the same file, so extract the 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) css/src/props/style/scrollbar.rs:610— css/src/props/style/scrollbar.rs:610-621 | css/src/system.rs:2196-2207 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) css/src/system.rs:802— css/src/system.rs:802-813 | css/src/system.rs:856-867 — both copies are in the same file, so extract the 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) css/src/system.rs:2222— css/src/system.rs:2222-2233 | css/src/system.rs:2274-2285 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/gamepad/playstation.rs:319— dll/src/desktop/extra/gamepad/playstation.rs:319-330 | dll/src/desktop/extra/gamepad/playstation.rs:358-369 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/media_keys/apple.rs:135— dll/src/desktop/extra/media_keys/apple.rs:135-146 | dll/src/desktop/extra/media_keys/apple.rs:575-586 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/sqlite/mod.rs:636— dll/src/desktop/extra/sqlite/mod.rs:636-647 | dll/src/desktop/extra/sqlite/mod.rs:686-697 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/common/event.rs:2052— dll/src/desktop/shell2/common/event.rs:2052-2063 | dll/src/desktop/shell2/linux/x11/events.rs:1815-1826 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) dll/src/desktop/shell2/common/event.rs:11842— dll/src/desktop/shell2/common/event.rs:11842-11853 | dll/src/desktop/shell2/common/event.rs:11935-11946 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/headless/mod.rs:1709— dll/src/desktop/shell2/headless/mod.rs:1709-1722 | dll/src/desktop/shell2/headless/mod.rs:1891-1902 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/system_style.rs:846— dll/src/desktop/shell2/linux/system_style.rs:846-857 | dll/src/desktop/shell2/windows/system_style.rs:385-396 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:2600— dll/src/desktop/shell2/linux/wayland/events.rs:2600-2611 | dll/src/desktop/shell2/linux/x11/mod.rs:1537-1548 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:3678— dll/src/desktop/shell2/linux/x11/mod.rs:3678-3689 | dll/src/desktop/shell2/linux/x11/mod.rs:3825-3837 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/macos/mod.rs:8885— dll/src/desktop/shell2/macos/mod.rs:8885-8896 | dll/src/desktop/shell2/macos/mod.rs:8906-8917 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/windows/mod.rs:2289— dll/src/desktop/shell2/windows/mod.rs:2289-2300 | dll/src/desktop/shell2/windows/mod.rs:2973-2984 — both copies are in the same file, so extract the 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) dll/src/web/transpiler_remill.rs:4875— dll/src/web/transpiler_remill.rs:4875-4886 | dll/src/web/transpiler_remill.rs:4952-4963 — both copies are in the same file, so extract the 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) dll/src/web/transpiler_remill.rs:5308— dll/src/web/transpiler_remill.rs:5308-5319 | dll/src/web/transpiler_remill.rs:5445-5456 — both copies are in the same file, so extract the 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) dll/src/web/transpiler_remill.rs:8637— dll/src/web/transpiler_remill.rs:8637-8648 | dll/src/web/transpiler_remill.rs:9274-9285 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/common/capability_pump.rs:233— dll/src/desktop/shell2/common/capability_pump.rs:233-244 | dll/src/desktop/shell2/common/capability_pump.rs:272-283 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) dll/src/desktop/compositor2.rs:636— dll/src/desktop/compositor2.rs:636-647 | dll/src/desktop/compositor2.rs:651-662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Repeated repair: core/src/task.rs core/src/task.rs:480— core/src/task.rs changed 28 times in last 90 days and 16 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Instant::linear_interpolate at line 480), 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): every callback kind hands its context to the callee”; “fix(animation): a declared transition animates on every toggle, on the CPU renderer too”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(api-remodel): 59 extreme-lint findings, and an int/real compare that was not SQLite's”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/task.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/src/refany.rs core/src/refany.rs:1489— core/src/refany.rs changed 22 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 10 (its worst body is RefAny::replace_contents at line 1489), 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): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(dl): a mid-list insert has FOUR side tables to keep, and a released RefAny must answer instead of aborting”; “fix(refactor): get core to compile again, fix imports”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/refany.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: examples/go/main.go examples/go/main.go:32— examples/go/main.go changed 22 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 2 (its worst body is main.main at line 32), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(go): remove redundant RunWindow method in favor of generated Run method”; “fix(go): update Go module path to azul.rs/ui/go”; “fix(go): update Go examples and codegen to use azul.rs import paths instead of github.com”; “fix(format): run rustfmt and apply all patches until convergence”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- examples/go/main.go`: 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: layout/src/widgets/tooltip.rs layout/src/widgets/tooltip.rs:279— layout/src/widgets/tooltip.rs changed 17 times in last 90 days and 9 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 azul_layout::widgets::tooltip::on_tooltip_enter 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(engine): make widget callbacks reachable from managed hosts; null-tolerant RefAny::is_type”; “fix(widgets): repair the CI breakage the no-compile chunks accumulated”; “fix(clippy): the extern "C" callbacks keep the #[must_use] the gate wants”; “fix(compile): get azul-layout to compile again”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/widgets/tooltip.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: layout/src/widgets/avatar.rs layout/src/widgets/avatar.rs:89— layout/src/widgets/avatar.rs 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 3 (its worst body is AvatarSize::diameter at line 89), 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: “test(avatar,split_pane): the bugs these tests pinned no longer exist”; “fix(clippy): aggressively apply clippy fixes”; “fix(refactor): try reverting the theme renaming errors”; “fix: rename theme -> ui theme, fix IR analyzer”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/widgets/avatar.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/src/db.rs core/src/db.rs:739— core/src/db.rs changed 12 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 azul_core::db::az_db_merge_callback_thunk at line 739), 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): every callback kind hands its context to the callee”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(build): the branch's own compile errors from its last CI run (34146408249)”; “fix(api-remodel): 59 extreme-lint findings, and an int/real compare that was not SQLite's”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/db.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: layout/src/managers/gpu_state.rs layout/src/managers/gpu_state.rs:261— layout/src/managers/gpu_state.rs changed 11 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 12 (its worst body is GpuStateManager::update_scrollbar_transforms at line 261), 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(format): run rustfmt and apply all patches until convergence”; “fix(render): an idle window asked WebRender for a frame 59 times a second”; “fix(scroll): a wheel gesture never ended — settle_scroll_gesture had no caller (2c-iv)”; “fix(input): 13a part 1 — azul-core and azul-layout compile”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/managers/gpu_state.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_fortran/functions.rs doc/src/codegen/v2/lang_fortran/functions.rs:81— doc/src/codegen/v2/lang_fortran/functions.rs 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 11 (its worst body is azul_doc::codegen::v2::lang_fortran::functions::should_emit_function at line 81), 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(fortran): the alias scheme hashed 31 symbols out of reach”; “fix(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_fortran/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: core/src/log_filter.rs core/src/log_filter.rs:225— core/src/log_filter.rs 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 14 (its worst body is azul_core::log_filter::category_from_name at line 225), 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(format): run rustfmt and apply all patches until convergence”; “fix(log): stderr_echo() never read the environment, so a direct emit went nowhere”; “fix(refactor): get core to compile again, fix imports”; “fix(core): restore the qualified `alloc::vec::Vec` in log_filter::parse's signature”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- core/src/log_filter.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_csharp/functions.rs doc/src/codegen/v2/lang_csharp/functions.rs:121— doc/src/codegen/v2/lang_csharp/functions.rs 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 azul_doc::codegen::v2::lang_csharp::functions::should_emit_function at line 121), 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(bindings): catch at every callback boundary, log, return the fallback”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_csharp/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_pascal/functions.rs doc/src/codegen/v2/lang_pascal/functions.rs:90— doc/src/codegen/v2/lang_pascal/functions.rs changed 7 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is azul_doc::codegen::v2::lang_pascal::functions::should_emit_function at line 90), 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(pascal): 45 constructors freed uninitialised memory”; “fix(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_pascal/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/extra/capability.rs dll/src/desktop/extra/capability.rs:264— dll/src/desktop/extra/capability.rs 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 9 (its worst body is PlatformCapability::sensors at line 264), 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(iroh): compile the engine only where its crypto provider builds”; “fix(build): ship the 32-bit Linux artifacts without the Db engine, which cannot compile there”; “fix(sensors): real IMU capability probes on macOS/Windows [MWA-C-sensors]”; “fix(geolocation): Windows COM Location API provider, real fix timestamps [MWA-C-geolocation]”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/extra/capability.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_java/functions.rs doc/src/codegen/v2/lang_java/functions.rs:154— doc/src/codegen/v2/lang_java/functions.rs 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 11 (its worst body is azul_doc::codegen::v2::lang_java::functions::should_emit_function at line 154), 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(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”; “fix(codegen): C#, Java, Node and PowerShell stop hiding the one derive they had”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_java/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/shell2/common/log_gate.rs dll/src/desktop/shell2/common/log_gate.rs:48— dll/src/desktop/shell2/common/log_gate.rs 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 13 (its worst body is azul_dll::desktop::shell2::common::log_gate::category_of at line 48), 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(log): log_*! printed nothing in the shipped DLL”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(diagnostics): a framework warning killed the app when stderr went away”; “fix(input): four bugs behind the scrolling, redraw, teardown and log noise”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/common/log_gate.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/extra/camera/avfoundation.rs dll/src/desktop/extra/camera/avfoundation.rs:123— dll/src/desktop/extra/camera/avfoundation.rs 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 9 (its worst body is azul_dll::desktop::extra::camera::avfoundation::preset_for at line 123), 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: “chore(dll): cargo fix --lib — 442 compiler-suggested fixes across 30 files”; “fix(format): run rustfmt and apply all patches until convergence”; “ci: the tier the Clippy gate was hiding — seven fixes for ten red jobs”; “fix(dll): macOS-only compile errors the Linux CI never saw”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/extra/camera/avfoundation.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_node/functions.rs doc/src/codegen/v2/lang_node/functions.rs:53— doc/src/codegen/v2/lang_node/functions.rs 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 9 (its worst body is azul_doc::codegen::v2::lang_node::functions::should_emit_function at line 53), 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(node): Option<Boxed> payloads were read after the option was freed”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”; “fix(codegen): C#, Java, Node and PowerShell stop hiding the one derive they had”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_node/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_ocaml/functions.rs doc/src/codegen/v2/lang_ocaml/functions.rs:61— doc/src/codegen/v2/lang_ocaml/functions.rs 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 11 (its worst body is azul_doc::codegen::v2::lang_ocaml::functions::should_emit_function at line 61), 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(ocaml): aliases had the wrong ABI size, and VecRef lost its length”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_ocaml/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/logging.rs dll/src/desktop/logging.rs:115— dll/src/desktop/logging.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is azul_dll::desktop::logging::set_up_panic_hooks at line 115), 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(panic): a recovered panic must not open the fatal dialog”; “fix(dll): the fatal-error dialog fits on the screen”; “chore(dll): cargo fix --lib — 442 compiler-suggested fixes across 30 files”; “fix(a11y): no TreeUpdate can abort the process; scroll updates the tree; crashes 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/logging.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/shell2/linux/x11/accessibility.rs dll/src/desktop/shell2/linux/x11/accessibility.rs:87— dll/src/desktop/shell2/linux/x11/accessibility.rs changed 6 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is LinuxAccessibilityAdapter::update_tree at line 87), 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(panic): a recovered panic must not open the fatal dialog”; “fix(a11y): hand a waiting adapter the whole tree, never an increment”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(a11y): aria-live attribute parsing + AT-SPI root window bounds [MWA-C-a11y]”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/linux/x11/accessibility.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/reftest/pipeline.rs doc/src/reftest/pipeline.rs:135— doc/src/reftest/pipeline.rs 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 10 (its worst body is azul_doc::reftest::pipeline::extract_metadata_from_string at line 135), 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(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(reftest): the hermetic fontconfig was never loaded — FONTCONFIG_FILE was relative”; “fix(reftest): pin the oracle's text rasterisation, not just its font families”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/reftest/pipeline.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_lisp/functions.rs doc/src/codegen/v2/lang_lisp/functions.rs:48— doc/src/codegen/v2/lang_lisp/functions.rs 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 azul_doc::codegen::v2::lang_lisp::functions::should_emit_function at line 48), 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(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_lisp/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: dll/src/desktop/shell2/windows/accessibility.rs dll/src/desktop/shell2/windows/accessibility.rs:96— dll/src/desktop/shell2/windows/accessibility.rs 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 6 (its worst body is WindowsAccessibilityAdapter::update_tree at line 96), 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(panic): a recovered panic must not open the fatal dialog”; “fix(a11y): hand a waiting adapter the whole tree, never an increment”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(a11y,hover,focus): output-drain sweep - deliver what was computed [MWA-A3]”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- dll/src/desktop/shell2/windows/accessibility.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_ada/functions.rs doc/src/codegen/v2/lang_ada/functions.rs:64— doc/src/codegen/v2/lang_ada/functions.rs 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 11 (its worst body is azul_doc::codegen::v2::lang_ada::functions::should_emit_function at line 64), 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(clippy): aggressively apply clippy fixes”; “fix(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_ada/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: doc/src/codegen/v2/lang_nim/functions.rs doc/src/codegen/v2/lang_nim/functions.rs:49— doc/src/codegen/v2/lang_nim/functions.rs 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 11 (its worst body is azul_doc::codegen::v2::lang_nim::functions::should_emit_function at line 49), 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(format): run rustfmt and apply all patches until convergence”; “fix(codegen): recursive types keep the traits they declare, in 23 bindings at once”; “fix(codegen): one shared predicate closes the `*VecDestructor` gap in twenty bindings”; “fix(e2e): scala JVM flag, nim codegen+crash, odin/powershell Windows”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- doc/src/codegen/v2/lang_nim/functions.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: layout/src/managers/eyedropper.rs layout/src/managers/eyedropper.rs:83— layout/src/managers/eyedropper.rs 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 2 (its worst body is EyedropperManager::fold_result at line 83), 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(format): run rustfmt and apply all patches until convergence”; “fix(layout): clear the 311 clippy errors, and the wasm clock gate, in azul-layout”; “fix(linux): the eyedropper no longer kills its picker popup; copy-out reads the host buffer”; “fix(clippy): satisfy the extreme -D warnings lints after the rebase”. 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-24..2026-09-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-24 16:34:54 +02:00' --until='2026-09-22 16:34:54 +02:00' --full-history --no-merges -- layout/src/managers/eyedropper.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Duplicated block (13 lines × 2) css/src/system.rs:2241— css/src/system.rs:2241-2253 | css/src/system.rs:2293-2305 — both copies are in the same file, so extract the 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) css/src/system.rs:2590— css/src/system.rs:2590-2602 | css/src/system.rs:2640-2652 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/common/event.rs:5419— dll/src/desktop/shell2/common/event.rs:5419-5431 | dll/src/desktop/shell2/common/event.rs:5448-5460 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/common/transient.rs:1032— dll/src/desktop/shell2/common/transient.rs:1032-1044 | dll/src/desktop/shell2/common/transient.rs:1087-1099 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/events.rs:363— dll/src/desktop/shell2/linux/wayland/events.rs:363-375 | dll/src/desktop/shell2/linux/wayland/events.rs:433-445 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/events.rs:2683— dll/src/desktop/shell2/linux/wayland/events.rs:2683-2695 | dll/src/desktop/shell2/linux/wayland/events.rs:2741-2753 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/events.rs:5253— dll/src/desktop/shell2/linux/wayland/events.rs:5253-5265 | dll/src/desktop/shell2/linux/x11/mod.rs:9449-9461 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6259— dll/src/desktop/shell2/linux/wayland/mod.rs:6259-6271 | dll/src/desktop/shell2/linux/x11/events.rs:1400-1412 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6380— dll/src/desktop/shell2/linux/wayland/mod.rs:6380-6392 | dll/src/desktop/shell2/linux/x11/events.rs:1508-1520 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) dll/src/web/classify.rs:134— dll/src/web/classify.rs:134-146 | doc/src/utils/string.rs:3-15 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) dll/src/web/transpiler_remill.rs:7785— dll/src/web/transpiler_remill.rs:7785-7797 | dll/src/web/transpiler_remill.rs:7804-7816 — both copies are in the same file, so extract the 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) dll/src/desktop/extra/permission/ios.rs:82— dll/src/desktop/extra/permission/ios.rs:82-94 | dll/src/desktop/extra/permission/macos.rs:182-194 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) doc/src/autofix/mod.rs:577— doc/src/autofix/mod.rs:577-589 | doc/src/autofix/patch_format.rs:589-601 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13 lines × 2) doc/src/autofix/type_index.rs:2039— doc/src/autofix/type_index.rs:2039-2051 | doc/src/autofix/type_index.rs:2234-2246 — both copies are in the same file, so extract the 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) doc/src/autotest/extract.rs:187— doc/src/autotest/extract.rs:187-199 | doc/src/autotest/extract.rs:213-225 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_cpp/cpp11.rs:170— doc/src/codegen/v2/lang_cpp/cpp11.rs:170-182 | doc/src/codegen/v2/lang_cpp/cpp17.rs:301-313 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_crystal/mod.rs:272— doc/src/codegen/v2/lang_crystal/mod.rs:272-284 | doc/src/codegen/v2/lang_crystal/types.rs:213-225 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:1996— doc/src/codegen/v2/lang_csharp/wrappers.rs:1996-2008 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:2037-2049 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 13 separate duplicated blocks between them, totalling at least 142 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_d/model.rs:392— doc/src/codegen/v2/lang_d/model.rs:392-404 | doc/src/codegen/v2/lang_swift/model.rs:397-409 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_fortran/mod.rs:270— doc/src/codegen/v2/lang_fortran/mod.rs:270-282 | doc/src/codegen/v2/lang_ocaml/mod.rs:272-284 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:492— doc/src/codegen/v2/lang_node/wrappers.rs:492-504 | doc/src/codegen/v2/lang_node/wrappers.rs:1210-1222 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_ruby/wrappers.rs:1269— doc/src/codegen/v2/lang_ruby/wrappers.rs:1269-1281 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1349-1361 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_rust.rs:1681— doc/src/codegen/v2/lang_rust.rs:1681-1693 | doc/src/codegen/v2/lang_rust.rs:2043-2055 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_rust.rs:3811— doc/src/codegen/v2/lang_rust.rs:3811-3823 | doc/src/codegen/v2/lang_rust.rs:3898-3910 — both copies are in the same file, so extract the 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) doc/src/reftest/autodebug.rs:2288— doc/src/reftest/autodebug.rs:2288-2300 | doc/src/reftest/autoreview.rs:2130-2142 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 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.
ClassTooLong: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544— ClassTooLong — 4755 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 132 methods, 7 blocks, lines 544-11092. The bar is 400 significant lines; this is 4355 over it, 11.89× 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: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593— ClassTooLong — 3445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 84 methods, 11 blocks, lines 1743-8843. The bar is 400 significant lines; this is 3045 over it, 8.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: Renderer webrender/core/src/renderer/mod.rs:761— ClassTooLong — 3144 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 86 methods, 3 blocks, lines 761-5971. The bar is 400 significant lines; this is 2744 over it, 7.86× 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: CssProperty css/src/props/property.rs:662— ClassTooLong — 2666 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 426 methods, 2 blocks, lines 662-7908. The bar is 400 significant lines; this is 2266 over it, 6.67× 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: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009— ClassTooLong — 2625 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 99 methods, 7 blocks, lines 4009-9323. The bar is 400 significant lines; this is 2225 over it, 6.56× 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: CssPropertyCache core/src/prop_cache.rs:1017— ClassTooLong — 2526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 75 methods, 5 blocks, lines 1017-5395. The bar is 400 significant lines; this is 2126 over it, 6.32× 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: SceneBuilder webrender/core/src/scene_building.rs:434— ClassTooLong — 2511 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 50 methods, 2 blocks, lines 434-4302. The bar is 400 significant lines; this is 2111 over it, 6.28× 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: CallbackInfo layout/src/callbacks.rs:1290— ClassTooLong — 2382 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 384 methods, 3 blocks, lines 1162-7027. The bar is 400 significant lines; this is 1982 over it, 5.96× 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: Win32Window dll/src/desktop/shell2/windows/mod.rs:147— ClassTooLong — 2366 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 8 blocks, lines 147-7844. The bar is 400 significant lines; this is 1966 over it, 5.92× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BatchBuilder webrender/core/src/batch.rs:729— ClassTooLong — 2061 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 2 blocks, lines 729-3635. The bar is 400 significant lines; this is 1661 over it, 5.15× 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: Device webrender/core/src/device/gl.rs:1076— ClassTooLong — 1725 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 133 methods, 2 blocks, lines 1076-4154. The bar is 400 significant lines; this is 1325 over it, 4.31× 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: Dom core/src/dom.rs:4237— ClassTooLong — 1461 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 247 methods, 8 blocks, lines 4237-7478. The bar is 400 significant lines; this is 1061 over it, 3.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: PicturePrimitive webrender/core/src/picture.rs:5154— ClassTooLong — 1309 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 2 blocks, lines 5154-7373. The bar is 400 significant lines; this is 909 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TileCacheInstance webrender/core/src/picture.rs:1689— ClassTooLong — 1298 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 1689-4048. The bar is 400 significant lines; this is 898 over it, 3.25× 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: Profiler webrender/core/src/profiler.rs:364— ClassTooLong — 1256 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 364-2052. The bar is 400 significant lines; this is 856 over it, 3.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GlContextPtr core/src/gl.rs:985— ClassTooLong — 1255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 229 methods, 10 blocks, lines 985-2935. The bar is 400 significant lines; this is 855 over it, 3.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ResourceCache webrender/core/src/resource_cache.rs:442— ClassTooLong — 1113 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 4 blocks, lines 442-2293. The bar is 400 significant lines; this is 713 over it, 2.78× 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: TaffyBridge layout/src/solver3/taffy_bridge.rs:673— ClassTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 8 blocks, lines 673-2545. The bar is 400 significant lines; this is 677 over it, 2.69× 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: GestureAndDragManager layout/src/managers/gesture.rs:720— ClassTooLong — 1019 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 99 methods, 5 blocks, lines 720-4554. The bar is 400 significant lines; this is 619 over it, 2.55× 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: StyledDom core/src/styled_dom.rs:994— ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 994-2826. The bar is 400 significant lines; this is 594 over it, 2.49× 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: NodeData core/src/dom.rs:1689— ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 113 methods, 13 blocks, lines 1689-4150. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HeadlessWindow dll/src/desktop/shell2/headless/mod.rs:1493— ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 1493-3196. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LayoutTreeBuilder layout/src/solver3/layout_tree.rs:2028— ClassTooLong — 850 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 2 blocks, lines 2028-3482. The bar is 400 significant lines; this is 450 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ColorU css/src/props/basic/color.rs:35— ClassTooLong — 829 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 140 methods, 5 blocks, lines 35-1375. The bar is 400 significant lines; this is 429 over it, 2.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: CssPropertyType css/src/props/property.rs:930— ClassTooLong — 824 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 5 blocks, lines 930-1905. The bar is 400 significant lines; this is 424 over it, 2.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (14 lines × 2) core/src/diff.rs:216— core/src/diff.rs:216-229 | core/src/styled_dom.rs:3341-3354 — 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 (14 lines × 2) core/src/style.rs:142— core/src/style.rs:142-155 | core/src/style.rs:186-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/extra/webtransport/mod.rs:101— dll/src/desktop/extra/webtransport/mod.rs:101-114 | dll/src/unified/webtransport.rs:155-168 — 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) dll/src/desktop/shell2/common/event.rs:8877— dll/src/desktop/shell2/common/event.rs:8877-8890 | dll/src/desktop/shell2/common/event.rs:8962-8975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4638— dll/src/desktop/shell2/linux/wayland/mod.rs:4638-4651 | dll/src/desktop/shell2/linux/wayland/mod.rs:5845-5858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:6354— dll/src/desktop/shell2/linux/wayland/mod.rs:6354-6367 | dll/src/desktop/shell2/linux/x11/events.rs:1486-1499 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10905— dll/src/desktop/shell2/linux/wayland/mod.rs:10905-10918 | dll/src/desktop/shell2/linux/wayland/mod.rs:11036-11049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:8662— dll/src/desktop/shell2/linux/x11/mod.rs:8662-8675 | dll/src/desktop/shell2/linux/x11/mod.rs:8787-8800 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/shell2/windows/mod.rs:1553— dll/src/desktop/shell2/windows/mod.rs:1553-1566 | dll/src/desktop/shell2/windows/mod.rs:1795-1808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/wr_translate2.rs:1841— dll/src/desktop/wr_translate2.rs:1841-1854 | dll/src/desktop/wr_translate2.rs:1882-1895 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) dll/src/desktop/extra/file_picker/ios.rs:380— dll/src/desktop/extra/file_picker/ios.rs:380-393 | dll/src/desktop/extra/file_picker/ios.rs:477-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/autofix/diff.rs:1007— doc/src/autofix/diff.rs:1007-1020 | doc/src/autofix/diff.rs:1023-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/autofix/workspace.rs:1530— doc/src/autofix/workspace.rs:1530-1543 | doc/src/autofix/workspace.rs:1575-1588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_d/mod.rs:519— doc/src/codegen/v2/lang_d/mod.rs:519-532 | doc/src/codegen/v2/lang_swift/mod.rs:462-475 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:618— doc/src/codegen/v2/lang_d/model.rs:618-631 | doc/src/codegen/v2/lang_swift/model.rs:635-648 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:672— doc/src/codegen/v2/lang_d/model.rs:672-685 | doc/src/codegen/v2/lang_swift/model.rs:689-702 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:791— doc/src/codegen/v2/lang_d/model.rs:791-804 | doc/src/codegen/v2/lang_swift/model.rs:797-810 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:213— doc/src/codegen/v2/lang_kotlin/wrappers.rs:213-226 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:271-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.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:705— doc/src/codegen/v2/lang_node/wrappers.rs:705-718 | doc/src/codegen/v2/lang_node/wrappers.rs:1176-1189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_rust.rs:2853— doc/src/codegen/v2/lang_rust.rs:2853-2866 | doc/src/codegen/v2/lang_rust.rs:3126-3139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/patch/mod.rs:388— doc/src/patch/mod.rs:388-401 | doc/src/patch/mod.rs:665-678 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/reftest/regression.rs:150— doc/src/reftest/regression.rs:150-163 | doc/src/reftest/regression.rs:176-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/reftest/regression.rs:1175— doc/src/reftest/regression.rs:1175-1188 | doc/src/reftest/regression.rs:1974-1987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) doc/src/codegen/v2/lang_cobol/functions.rs:134— doc/src/codegen/v2/lang_cobol/functions.rs:134-147 | doc/src/codegen/v2/lang_cobol/types.rs:435-448 — 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 (14 lines × 2) layout/src/cpurender/raster.rs:92— layout/src/cpurender/raster.rs:92-105 | layout/src/cpurender/raster.rs:129-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
LayoutWindow::layout_dom_recursive_impl (cognitive 215) layout/src/window.rs:5543— LayoutWindow::layout_dom_recursive_impl has cognitive complexity 215 (threshold 15). Drivers by points: if/else 74 (165 pts), loops 10 (24 pts), match/switch 5 (19 pts), boolean chains 7 (nesting depth added 119). 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.
LayoutWindow::reshape_text_node (cognitive 148) layout/src/window.rs:17383— LayoutWindow::reshape_text_node has cognitive complexity 148 (threshold 15). Drivers by points: if/else 49 (129 pts), loops 5 (12 pts), boolean chains 6, match/switch 1 (nesting depth added 87). 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.
LayoutWindow::apply_text_tweens (cognitive 134) layout/src/window.rs:8915— LayoutWindow::apply_text_tweens has cognitive complexity 134 (threshold 15). Drivers by points: if/else 43 (92 pts), match/switch 11 (24 pts), boolean chains 12, loops 3 (6 pts) (nesting depth added 65). 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.
LayoutWindow::process_mouse_click_for_selection (cognitive 114) layout/src/window.rs:19366— LayoutWindow::process_mouse_click_for_selection has cognitive complexity 114 (threshold 15). Drivers by points: if/else 31 (84 pts), loops 6 (14 pts), match/switch 3 (13 pts), boolean chains 3 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::begin_reconciliation (cognitive 91) layout/src/window.rs:10861— LayoutWindow::begin_reconciliation has cognitive complexity 91 (threshold 15). Drivers by points: if/else 24 (70 pts), loops 8 (15 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 55). 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.
LayoutWindow::tick_animations (cognitive 87) layout/src/window.rs:11609— LayoutWindow::tick_animations has cognitive complexity 87 (threshold 15). Drivers by points: if/else 23 (63 pts), loops 8 (14 pts), match/switch 2 (7 pts), boolean chains 3 (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LayoutWindow::run_track_frames (cognitive 80) layout/src/window.rs:13918— LayoutWindow::run_track_frames has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (62 pts), loops 5 (11 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 51). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
LayoutWindow::process_accessibility_action (cognitive 76) layout/src/window.rs:15882— LayoutWindow::process_accessibility_action has cognitive complexity 76 (threshold 15). Drivers by points: if/else 28 (64 pts), loops 3 (6 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 41). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LayoutWindow::composite_zombies_cpu (cognitive 66) layout/src/window.rs:25345— LayoutWindow::composite_zombies_cpu has cognitive complexity 66 (threshold 15). Drivers by points: if/else 20 (49 pts), loops 5 (10 pts), match/switch 2 (5 pts), boolean chains 2 (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.
LayoutWindow::get_selected_content_for_clipboard (cognitive 60) layout/src/window.rs:20281— LayoutWindow::get_selected_content_for_clipboard has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (51 pts), loops 2 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 38). 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.
LayoutWindow::layout_and_generate_display_list_impl (cognitive 48) layout/src/window.rs:2306— LayoutWindow::layout_and_generate_display_list_impl has cognitive complexity 48 (threshold 15). Drivers by points: if/else 23 (35 pts), loops 6 (11 pts), boolean chains 2 (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.
LayoutWindow::select_next_occurrence (cognitive 47) layout/src/window.rs:13202— LayoutWindow::select_next_occurrence has cognitive complexity 47 (threshold 15). Drivers by points: if/else 22 (41 pts), match/switch 4 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::update_a11y_tree_incremental (cognitive 40) layout/src/window.rs:12332— LayoutWindow::update_a11y_tree_incremental has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 1 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::apply_seat_selection_op (cognitive 34) layout/src/window.rs:10474— LayoutWindow::apply_seat_selection_op has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 5 (12 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LayoutWindow::synchronize_scrollbar_opacity (cognitive 34) layout/src/window.rs:11883— LayoutWindow::synchronize_scrollbar_opacity has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 2 (6 pts), boolean chains 3, loops 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.
LayoutWindow::finish_reconciliation (cognitive 33) layout/src/window.rs:11286— LayoutWindow::finish_reconciliation has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (26 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::apply_one_text_changeset (cognitive 33) layout/src/window.rs:16478— LayoutWindow::apply_one_text_changeset has cognitive complexity 33 (threshold 15). Drivers by points: if/else 26 (31 pts), boolean chains 1, match/switch 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.
LayoutWindow::queue_resize_events_after_layout (cognitive 31) layout/src/window.rs:20557— LayoutWindow::queue_resize_events_after_layout has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (5 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.
LayoutWindow::regenerate_display_list_for_dom (cognitive 30) layout/src/window.rs:18150— LayoutWindow::regenerate_display_list_for_dom has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::extract_clipboard_ranges (cognitive 30) layout/src/window.rs:20208— LayoutWindow::extract_clipboard_ranges has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::try_incremental_text_relayout (cognitive 26) layout/src/window.rs:18688— LayoutWindow::try_incremental_text_relayout has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutWindow::remap_node_ids (cognitive 26) layout/src/window.rs:20900— LayoutWindow::remap_node_ids has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 3 (7 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.
LayoutWindow::caret_node_position_for_seat (cognitive 25) layout/src/window.rs:3532— LayoutWindow::caret_node_position_for_seat has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 3 (5 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.
LayoutWindow::zombie_paint_rects (cognitive 25) layout/src/window.rs:25610— LayoutWindow::zombie_paint_rects has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (5 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.
LayoutWindow::finalize_pending_focus_changes (cognitive 24) layout/src/window.rs:9890— LayoutWindow::finalize_pending_focus_changes has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 4, loops 2 (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.
azul_core::compact::apply_css_property_to_compact (cognitive 186) core/src/compact.rs:1305— azul_core::compact::apply_css_property_to_compact has cognitive complexity 186 (threshold 15). Drivers by points: if/else 83 (175 pts), match/switch 3 (7 pts), boolean chains 4 (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::xml::apply_xml_node_attributes (cognitive 97) core/src/xml.rs:5774— azul_core::xml::apply_xml_node_attributes has cognitive complexity 97 (threshold 15). Drivers by points: if/else 40 (76 pts), boolean chains 7, loops 3 (7 pts), match/switch 3 (7 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::diff::reconcile_dom (cognitive 93) core/src/diff.rs:569— azul_core::diff::reconcile_dom has cognitive complexity 93 (threshold 15). Drivers by points: if/else 29 (75 pts), loops 10, boolean chains 8 (nesting depth added 46). Of this number, 90 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::resources::build_add_font_resource_updates (cognitive 58) core/src/resources.rs:3669— azul_core::resources::build_add_font_resource_updates has cognitive complexity 58 (threshold 15). Drivers by points: if/else 7 (28 pts), loops 5 (15 pts), match/switch 3 (11 pts), boolean chains 4 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::diff::compute_node_changes (cognitive 49) core/src/diff.rs:175— azul_core::diff::compute_node_changes has cognitive complexity 49 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 4 (9 pts), boolean chains 2, match/switch 1 (nesting depth added 22). Of this number, 46 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::xml::analyze_node_ctor (cognitive 48) core/src/xml.rs:7947— azul_core::xml::analyze_node_ctor has cognitive complexity 48 (threshold 15). Drivers by points: if/else 29 (45 pts), boolean chains 2, match/switch 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::compact::update_dom_declared_flags (cognitive 47) core/src/compact.rs:1937— azul_core::compact::update_dom_declared_flags has cognitive complexity 47 (threshold 15). Drivers by points: if/else 23 (46 pts), match/switch 1 (nesting depth added 23). 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.
azul_core::path_parser::parse_svg_path_d (cognitive 47) core/src/path_parser.rs:423— azul_core::path_parser::parse_svg_path_d has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (32 pts), match/switch 3 (9 pts), loops 2 (4 pts), boolean chains 2 (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.
azul_core::styled_dom::is_layout_equivalent (cognitive 41) core/src/styled_dom.rs:3281— azul_core::styled_dom::is_layout_equivalent has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 2 (5 pts), loops 2 (3 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.
azul_core::events::handle_key_down (cognitive 35) core/src/events.rs:5081— azul_core::events::handle_key_down has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (30 pts), match/switch 2 (5 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.
azul_core::style::matches_html_element (cognitive 33) core/src/style.rs:63— azul_core::style::matches_html_element has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 3 (8 pts), loops 3 (7 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::diff::calculate_reconciliation_key (cognitive 32) core/src/diff.rs:361— azul_core::diff::calculate_reconciliation_key has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 5 (8 pts), match/switch 1 (2 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.
azul_core::xml::split_dynamic_string (cognitive 32) core/src/xml.rs:6740— azul_core::xml::split_dynamic_string has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (5 pts), match/switch 1 (2 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.
azul_core::db::az_db_merge_callback_thunk (cognitive 31) core/src/db.rs:739— azul_core::db::az_db_merge_callback_thunk has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (27 pts), match/switch 3 (4 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.
azul_core::diff::calculate_contenteditable_key (cognitive 30) core/src/diff.rs:1426— azul_core::diff::calculate_contenteditable_key has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 5 (7 pts), match/switch 1 (2 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.
azul_core::xml::group_matches (cognitive 30) core/src/xml.rs:7140— azul_core::xml::group_matches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 1 (2 pts), loops 1 (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.
azul_core::diff::transfer_states (cognitive 26) core/src/diff.rs:1223— azul_core::diff::transfer_states has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (20 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::xml::decode_entities (cognitive 26) core/src/xml.rs:6913— azul_core::xml::decode_entities has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 1 (5 pts), loops 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
azul_core::diff::fingerprint_dom (cognitive 25) core/src/diff.rs:2325— azul_core::diff::fingerprint_dom has cognitive complexity 25 (threshold 15). Drivers by points: loops 10 (15 pts), if/else 4 (5 pts), match/switch 3 (5 pts) (nesting depth added 8). Most of this is not in the body itself: 2 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (node_style_hash, node_structure_hash, walk). 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.
azul_core::style::construct_html_cascade_tree (cognitive 24) core/src/style.rs:351— azul_core::style::construct_html_cascade_tree has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (9 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.
azul_core::ua_css::evaluate_ua_scrollbar_css (cognitive 23) core/src/ua_css.rs:1590— azul_core::ua_css::evaluate_ua_scrollbar_css has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 1 (2 pts), boolean chains 1, 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.
azul_core::xml::user_defined_render_fn (cognitive 23) core/src/xml.rs:2993— azul_core::xml::user_defined_render_fn has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (10 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.
azul_core::xml::compile_body_node_to_rust_code (cognitive 22) core/src/xml.rs:7227— azul_core::xml::compile_body_node_to_rust_code has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), match/switch 2 (7 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.
azul_core::xml::compile_node_to_rust_code_inner (cognitive 22) core/src/xml.rs:7462— azul_core::xml::compile_node_to_rust_code_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), match/switch 2 (5 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.
azul_core::prop_cache::clone_inheritable_property (cognitive 21) core/src/prop_cache.rs:1493— azul_core::prop_cache::clone_inheritable_property has cognitive complexity 21 (threshold 15). Drivers by points: if/else 21. 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.
Duplicated block (15 lines × 2) dll/src/desktop/shell2/android/mod.rs:2742— dll/src/desktop/shell2/android/mod.rs:2742-2756 | dll/src/desktop/shell2/android/mod.rs:3032-3046 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:10867— dll/src/desktop/shell2/linux/wayland/mod.rs:10867-10881 | dll/src/desktop/shell2/linux/x11/mod.rs:8625-8639 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) dll/src/desktop/shell2/macos/mod.rs:3652— dll/src/desktop/shell2/macos/mod.rs:3652-3666 | dll/src/desktop/shell2/macos/mod.rs:3837-3851 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/windows/mod.rs:5823— dll/src/desktop/shell2/windows/mod.rs:5823-5837 | dll/src/desktop/shell2/windows/mod.rs:6030-6044 — both copies are in the same file, so extract the 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) dll/src/desktop/tray/linux.rs:464— dll/src/desktop/tray/linux.rs:464-478 | dll/src/desktop/tray/linux.rs:822-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) doc/src/api.rs:2127— doc/src/api.rs:2127-2141 | doc/src/api.rs:2398-2412 — both copies are in the same file, so extract the 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) doc/src/autofix/mod.rs:2238— doc/src/autofix/mod.rs:2238-2252 | doc/src/autofix/mod.rs:2272-2286 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:573— doc/src/codegen/v2/lang_cpp/cpp03.rs:573-587 | doc/src/codegen/v2/lang_cpp/cpp11.rs:494-508 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:424— doc/src/codegen/v2/lang_haskell/types.rs:424-438 | doc/src/codegen/v2/lang_haskell/types.rs:796-810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) doc/src/codegen/v2/lang_rust.rs:2771— doc/src/codegen/v2/lang_rust.rs:2771-2785 | doc/src/codegen/v2/lang_rust.rs:3034-3048 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_rust.rs:2947— doc/src/codegen/v2/lang_rust.rs:2947-2961 | doc/src/codegen/v2/lang_rust.rs:3338-3352 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/rust/dynamic_binding.rs:415— doc/src/codegen/v2/rust/dynamic_binding.rs:415-429 | doc/src/codegen/v2/rust/static_binding.rs:504-518 — before extracting anything, compare `doc/src/codegen/v2/rust/dynamic_binding.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) doc/src/patch/fallback.rs:235— doc/src/patch/fallback.rs:235-249 | doc/src/patch/index.rs:932-946 — 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 (15 lines × 2) doc/src/codegen/v2/lang_ocaml/types.rs:838— doc/src/codegen/v2/lang_ocaml/types.rs:838-852 | doc/src/codegen/v2/lang_ocaml/types.rs:859-873 — both copies are in the same file, so extract the 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) layout/src/solver3/fc.rs:8816— layout/src/solver3/fc.rs:8816-8830 | layout/src/solver3/fc.rs:9882-9898 — both copies are in the same file, so extract the 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) layout/src/solver3/fc.rs:8803— layout/src/solver3/fc.rs:8803-8818 | layout/src/solver3/fc.rs:9313-9327 — both copies are in the same file, so extract the 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) layout/src/solver3/fc.rs:8834— layout/src/solver3/fc.rs:8834-8848 | layout/src/solver3/fc.rs:9676-9691 — both copies are in the same file, so extract the 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) layout/src/solver3/paged_layout.rs:733— layout/src/solver3/paged_layout.rs:733-747 | layout/src/solver3/paged_layout.rs:800-814 — both copies are in the same file, so extract the 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) layout/src/widgets/date_picker.rs:792— layout/src/widgets/date_picker.rs:792-806 | layout/src/widgets/time_picker.rs:593-610 — 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 (15 lines × 2) layout/src/widgets/node_graph.rs:2259— layout/src/widgets/node_graph.rs:2259-2273 | layout/src/widgets/node_graph.rs:2275-2289 — both copies are in the same file, so extract the 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) webrender/core/src/frame_builder.rs:615— webrender/core/src/frame_builder.rs:615-629 | webrender/core/src/frame_builder.rs:657-671 — both copies are in the same file, so extract the 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) webrender/core/src/prim_store/gradient/conic.rs:242— webrender/core/src/prim_store/gradient/conic.rs:242-256 | webrender/core/src/prim_store/gradient/radial.rs:207-221 — before extracting anything, compare `webrender/core/src/prim_store/gradient/conic.rs` and `webrender/core/src/prim_store/gradient/radial.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:7126— dll/src/desktop/shell2/linux/wayland/mod.rs:7126-7143 | dll/src/desktop/shell2/linux/x11/mod.rs:6428-6442 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10846— dll/src/desktop/shell2/linux/wayland/mod.rs:10846-10863 | dll/src/desktop/shell2/linux/x11/mod.rs:8607-8621 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) doc/src/codegen/v2/lang_java/wrappers.rs:239— doc/src/codegen/v2/lang_java/wrappers.rs:239-256 | doc/src/codegen/v2/lang_node/wrappers.rs:513-527 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_node/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) core/src/diff.rs:366— core/src/diff.rs:366-381 | core/src/diff.rs:1431-1446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/src/resources.rs:2809— core/src/resources.rs:2809-2824 | core/src/resources.rs:2960-2975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/common/event.rs:686— dll/src/desktop/shell2/common/event.rs:686-701 | dll/src/desktop/shell2/common/event.rs:996-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10985— dll/src/desktop/shell2/linux/wayland/mod.rs:10985-11000 | dll/src/desktop/shell2/linux/x11/mod.rs:8739-8754 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/linux/wayland/screencopy.rs:97— dll/src/desktop/shell2/linux/wayland/screencopy.rs:97-112 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:135-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:3702— dll/src/desktop/shell2/linux/x11/mod.rs:3702-3717 | dll/src/desktop/shell2/linux/x11/mod.rs:3755-3770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/macos/mod.rs:5690— dll/src/desktop/shell2/macos/mod.rs:5690-5705 | dll/src/desktop/shell2/windows/mod.rs:774-789 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) dll/src/desktop/shell2/common/debug_server/platform.rs:394— dll/src/desktop/shell2/common/debug_server/platform.rs:394-409 | dll/src/desktop/shell2/common/debug_server/platform.rs:427-442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/autofix/mod.rs:2168— doc/src/autofix/mod.rs:2168-2183 | doc/src/autofix/mod.rs:2310-2325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/autofix/type_index.rs:387— doc/src/autofix/type_index.rs:387-402 | doc/src/autofix/type_index.rs:458-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1759— doc/src/codegen/v2/lang_d/wrappers.rs:1759-1774 | doc/src/codegen/v2/lang_swift/wrappers.rs:1735-1750 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:735— doc/src/codegen/v2/lang_haskell/types.rs:735-750 | doc/src/codegen/v2/lang_haskell/types.rs:1014-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_rust.rs:3787— doc/src/codegen/v2/lang_rust.rs:3787-3802 | doc/src/codegen/v2/lang_rust.rs:3875-3890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/docgen/guide.rs:716— doc/src/docgen/guide.rs:716-731 | doc/src/lint_links.rs:256-271 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) doc/src/reftest/autoreview.rs:1192— doc/src/reftest/autoreview.rs:1192-1207 | doc/src/reftest/autoreview.rs:1631-1646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_odin/types.rs:233— doc/src/codegen/v2/lang_odin/types.rs:233-248 | doc/src/codegen/v2/lang_v/types.rs:241-256 — `doc/src/codegen/v2/lang_odin/types.rs` and `doc/src/codegen/v2/lang_v/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_cobol/types.rs:174— doc/src/codegen/v2/lang_cobol/types.rs:174-189 | doc/src/codegen/v2/lang_pascal/types.rs:108-123 — `doc/src/codegen/v2/lang_cobol/types.rs` and `doc/src/codegen/v2/lang_pascal/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 2) doc/src/codegen/v2/lang_pascal/mod.rs:322— doc/src/codegen/v2/lang_pascal/mod.rs:322-337 | doc/src/codegen/v2/lang_pascal/types.rs:563-578 — 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 (16 lines × 2) layout/src/cpurender/compositor.rs:1669— layout/src/cpurender/compositor.rs:1669-1684 | layout/src/cpurender/compositor.rs:1750-1765 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) layout/src/solver3/paged_layout.rs:394— layout/src/solver3/paged_layout.rs:394-409 | layout/src/solver3/paged_layout.rs:461-476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) webrender/core/src/batch.rs:1429— webrender/core/src/batch.rs:1429-1444 | webrender/core/src/batch.rs:2326-2341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) webrender/core/src/prim_store/gradient/conic.rs:148— webrender/core/src/prim_store/gradient/conic.rs:148-163 | webrender/core/src/prim_store/gradient/radial.rs:151-166 — before extracting anything, compare `webrender/core/src/prim_store/gradient/conic.rs` and `webrender/core/src/prim_store/gradient/radial.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 84 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) webrender/core/src/quad.rs:152— webrender/core/src/quad.rs:152-167 | webrender/core/src/quad.rs:207-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) layout/src/widgets/check_box.rs:218— layout/src/widgets/check_box.rs:218-233 | layout/src/widgets/switch.rs:271-287 — 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 (16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1800— dll/src/desktop/shell2/linux/wayland/mod.rs:1800-1817 | dll/src/desktop/shell2/linux/wayland/mod.rs:6422-6437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×28
Members sharing a duplicated core (4 members, 50+ identical tokens) core/src/xml.rs:8357— core/src/xml.rs:8357-8461 | core/src/xml.rs:8472-8524 | core/src/xml.rs:8644-8753 | core/src/xml.rs:8763-8843 — 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) dll/src/desktop/display.rs:1058— dll/src/desktop/display.rs:1058-1137 | dll/src/desktop/display.rs:1140-1209 | dll/src/desktop/display.rs:1212-1295 | dll/src/desktop/display.rs:1298-1421 — 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) dll/src/desktop/extra/camera/windows.rs:447— dll/src/desktop/extra/camera/windows.rs:447-460 | dll/src/desktop/extra/capture_slot.rs:125-132 | dll/src/desktop/extra/screencap/windows.rs:286-373 | layout/src/cpurender/raster.rs:4611-4658 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4950— dll/src/desktop/shell2/linux/wayland/mod.rs:4950-5060 | dll/src/desktop/shell2/linux/x11/events.rs:875-999 | dll/src/desktop/shell2/macos/events.rs:459-703 | dll/src/desktop/shell2/windows/mod.rs:4030-6901 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6257— dll/src/desktop/shell2/linux/wayland/mod.rs:6257-6271 | dll/src/desktop/shell2/linux/x11/events.rs:1398-1412 | dll/src/desktop/shell2/macos/events.rs:1149-1171 | dll/src/desktop/shell2/windows/mod.rs:2155-2171 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6275— dll/src/desktop/shell2/linux/wayland/mod.rs:6275-6285 | dll/src/desktop/shell2/linux/x11/events.rs:1416-1426 | dll/src/desktop/shell2/macos/events.rs:1176-1195 | dll/src/desktop/shell2/windows/mod.rs:2175-2190 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6294— dll/src/desktop/shell2/linux/wayland/mod.rs:6294-6312 | dll/src/desktop/shell2/linux/x11/events.rs:1435-1453 | dll/src/desktop/shell2/macos/events.rs:1109-1140 | dll/src/desktop/shell2/windows/mod.rs:2198-2221 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:6540— dll/src/desktop/shell2/linux/wayland/mod.rs:6540-6551 | dll/src/desktop/shell2/linux/x11/mod.rs:6280-6291 | dll/src/desktop/shell2/macos/mod.rs:6084-6095 | dll/src/desktop/shell2/windows/mod.rs:2233-2244 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7011— dll/src/desktop/shell2/linux/wayland/mod.rs:7011-8271 | dll/src/desktop/shell2/linux/x11/mod.rs:6380-7131 | dll/src/desktop/shell2/macos/mod.rs:7700-8438 | dll/src/desktop/shell2/windows/mod.rs:1139-1812 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:10423— dll/src/desktop/shell2/linux/wayland/mod.rs:10423-10463 | dll/src/desktop/shell2/linux/wayland/mod.rs:10466-10496 | dll/src/desktop/shell2/linux/wayland/mod.rs:10575-10605 | dll/src/desktop/shell2/linux/wayland/mod.rs:10607-10629 — 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) dll/src/desktop/shell2/linux/wayland/screencopy.rs:172— dll/src/desktop/shell2/linux/wayland/screencopy.rs:172-233 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:244-310 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:315-365 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:374-418 — 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) dll/src/desktop/shell2/linux/x11/mod.rs:5919— dll/src/desktop/shell2/linux/x11/mod.rs:5919-5953 | dll/src/desktop/shell2/linux/x11/mod.rs:5959-5998 | dll/src/desktop/shell2/linux/x11/mod.rs:7358-7441 | dll/src/desktop/shell2/linux/x11/mod.rs:8428-8482 — 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:490— doc/src/codegen/v2/lang_cpp/cpp03.rs:490-529 | doc/src/codegen/v2/lang_cpp/cpp11.rs:393-439 | doc/src/codegen/v2/lang_cpp/cpp17.rs:572-616 | doc/src/codegen/v2/lang_cpp/cpp20.rs:259-317 — 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) doc/src/codegen/v2/lang_cpp/cpp03.rs:554— doc/src/codegen/v2/lang_cpp/cpp03.rs:554-587 | doc/src/codegen/v2/lang_cpp/cpp11.rs:474-508 | doc/src/codegen/v2/lang_cpp/cpp17.rs:663-700 | doc/src/codegen/v2/lang_cpp/cpp20.rs:362-399 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:72— doc/src/codegen/v2/lang_csharp/wrappers.rs:72-134 | doc/src/codegen/v2/lang_java/wrappers.rs:1228-1294 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:69-131 | doc/src/codegen/v2/lang_node/wrappers.rs:1286-1351 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:519— doc/src/codegen/v2/lang_csharp/wrappers.rs:519-533 | doc/src/codegen/v2/lang_java/wrappers.rs:105-119 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:352-366 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:94-108 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:1425— doc/src/codegen/v2/lang_csharp/wrappers.rs:1425-1938 | doc/src/codegen/v2/lang_java/wrappers.rs:1342-1717 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1538-1733 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1742-1978 — 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) doc/src/codegen/v2/lang_crystal/types.rs:134— doc/src/codegen/v2/lang_crystal/types.rs:134-154 | doc/src/codegen/v2/lang_julia/types.rs:170-192 | doc/src/codegen/v2/lang_odin/types.rs:118-138 | doc/src/codegen/v2/lang_v/types.rs:123-143 — 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) doc/src/codegen/v2/lang_ada/types.rs:107— doc/src/codegen/v2/lang_ada/types.rs:107-194 | doc/src/codegen/v2/lang_cobol/types.rs:152-205 | doc/src/codegen/v2/lang_fortran/types.rs:61-172 | doc/src/codegen/v2/lang_pascal/types.rs:48-146 — 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) doc/src/codegen/v2/lang_crystal/functions.rs:81— doc/src/codegen/v2/lang_crystal/functions.rs:81-114 | doc/src/codegen/v2/lang_d/functions.rs:51-73 | doc/src/codegen/v2/lang_odin/functions.rs:53-85 | doc/src/codegen/v2/lang_v/functions.rs:72-99 — 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) doc/src/codegen/v2/lang_freebasic/types.rs:149— doc/src/codegen/v2/lang_freebasic/types.rs:149-174 | doc/src/codegen/v2/lang_freebasic/types.rs:180-289 | doc/src/codegen/v2/lang_vb6/types.rs:166-192 | doc/src/codegen/v2/lang_vb6/types.rs:216-281 — 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) layout/src/cpurender/pixmap.rs:65— layout/src/cpurender/pixmap.rs:65-124 | layout/src/cpurender/pixmap.rs:169-308 | layout/src/cpurender/pixmap.rs:348-489 | layout/src/cpurender/raster.rs:4663-4687 — 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) layout/src/font.rs:2504— layout/src/font.rs:2504-2514 | layout/src/font.rs:2516-2526 | layout/src/text3/default.rs:381-391 | layout/src/text3/default.rs:393-404 — 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) layout/src/widgets/backstage.rs:244— layout/src/widgets/backstage.rs:244-301 | layout/src/widgets/quick_access.rs:289-334 | layout/src/widgets/ribbon.rs:621-634 | layout/src/widgets/statusbar.rs:312-357 — 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) layout/src/widgets/quick_access.rs:363— layout/src/widgets/quick_access.rs:363-377 | layout/src/widgets/quick_access.rs:406-420 | layout/src/widgets/statusbar.rs:426-440 | layout/src/widgets/statusbar.rs:465-479 — 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 (7 lines × 3) core/src/events.rs:1780— core/src/events.rs:1780-1786 | core/src/events.rs:1910-1916 | core/src/events.rs:2069-2075 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) core/src/xml.rs:7294— core/src/xml.rs:7294-7300 | core/src/xml.rs:8504-8510 | core/src/xml.rs:8801-8807 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:4423— dll/src/desktop/shell2/linux/x11/mod.rs:4423-4429 | dll/src/desktop/shell2/linux/x11/mod.rs:5640-5646 | dll/src/desktop/shell2/linux/x11/mod.rs:7930-7936 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_c.rs:634— doc/src/codegen/v2/lang_c.rs:634-641 | doc/src/codegen/v2/lang_c.rs:912-918 | doc/src/codegen/v2/lang_c.rs:999-1005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:511— doc/src/codegen/v2/lang_crystal/model.rs:511-517 | doc/src/codegen/v2/lang_d/model.rs:807-813 | doc/src/codegen/v2/lang_swift/model.rs:813-819 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:1770— doc/src/codegen/v2/lang_csharp/wrappers.rs:1770-1776 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1838-1844 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1886-1892 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_java/managed.rs:967— doc/src/codegen/v2/lang_java/managed.rs:967-973 | doc/src/codegen/v2/lang_lua/managed.rs:185-191 | doc/src/codegen/v2/lang_node/managed.rs:141-147 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_java/wrappers.rs:1574— doc/src/codegen/v2/lang_java/wrappers.rs:1574-1580 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1609-1615 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1850-1856 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) doc/src/main.rs:649— doc/src/main.rs:649-655 | doc/src/main.rs:686-692 | doc/src/main.rs:1153-1159 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/main.rs:744— doc/src/main.rs:744-750 | doc/src/main.rs:964-970 | doc/src/main.rs:1212-1218 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:142— doc/src/codegen/v2/lang_ada/types.rs:142-148 | doc/src/codegen/v2/lang_cobol/types.rs:165-171 | doc/src/codegen/v2/lang_pascal/types.rs:99-105 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_crystal/functions.rs:89— doc/src/codegen/v2/lang_crystal/functions.rs:89-95 | doc/src/codegen/v2/lang_odin/functions.rs:61-67 | doc/src/codegen/v2/lang_v/functions.rs:80-86 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_ruby/types.rs:270— doc/src/codegen/v2/lang_ruby/types.rs:270-276 | doc/src/codegen/v2/lang_ruby/types.rs:508-514 | doc/src/codegen/v2/lang_ruby/types.rs:619-625 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) layout/src/callbacks.rs:1568— layout/src/callbacks.rs:1568-1574 | layout/src/callbacks.rs:1592-1598 | layout/src/callbacks.rs:1616-1622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) layout/src/solver3/paged_layout.rs:309— layout/src/solver3/paged_layout.rs:309-317 | layout/src/solver3/paged_layout.rs:2549-2557 | layout/src/window.rs:5659-5665 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) core/src/callbacks.rs:665— core/src/callbacks.rs:665-671 | core/src/callbacks.rs:1431-1437 | layout/src/callbacks.rs:7298-7304 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) dll/src/desktop/shell2/android/mod.rs:613— dll/src/desktop/shell2/android/mod.rs:613-619 | dll/src/desktop/shell2/ios/mod.rs:2061-2067 | dll/src/desktop/shell2/linux/wayland/mod.rs:10117-10123 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) dll/src/desktop/shell2/android/mod.rs:623— dll/src/desktop/shell2/android/mod.rs:623-629 | dll/src/desktop/shell2/ios/mod.rs:2071-2077 | dll/src/desktop/shell2/linux/wayland/mod.rs:10128-10134 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1384— doc/src/codegen/v2/lang_crystal/wrappers.rs:1384-1390 | doc/src/codegen/v2/lang_d/wrappers.rs:2286-2292 | doc/src/codegen/v2/lang_swift/wrappers.rs:2265-2271 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 3) layout/src/managers/geolocation.rs:297— layout/src/managers/geolocation.rs:297-303 | layout/src/managers/geolocation.rs:316-322 | layout/src/managers/sensors.rs:178-184 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_d/functions.rs:33— doc/src/codegen/v2/lang_d/functions.rs:33-39 | doc/src/codegen/v2/lang_odin/functions.rs:36-43 | doc/src/codegen/v2/lang_odin/functions.rs:93-100 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) dll/src/web/transpiler_remill.rs:5309— dll/src/web/transpiler_remill.rs:5309-5315 | dll/src/web/transpiler_remill.rs:5390-5396 | dll/src/web/transpiler_remill.rs:5446-5452 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_cobol/types.rs:510— doc/src/codegen/v2/lang_cobol/types.rs:510-516 | doc/src/codegen/v2/lang_lisp/mod.rs:471-477 | doc/src/codegen/v2/lang_racket/mod.rs:316-322 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) doc/src/codegen/v2/lang_haskell/functions.rs:78— doc/src/codegen/v2/lang_haskell/functions.rs:78-84 | doc/src/codegen/v2/lang_haskell/functions.rs:106-112 | doc/src/codegen/v2/lang_haskell/functions.rs:245-251 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) css/src/props/layout/shape.rs:48— css/src/props/layout/shape.rs:48-54 | css/src/props/layout/shape.rs:94-100 | css/src/props/layout/shape.rs:140-146 — 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.
Low cohesion: CssPropertyCache (LCOM4 25) core/src/prop_cache.rs:1017— CssPropertyCache's methods fall into 25 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 25 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: HttpRequestConfig (LCOM4 10) layout/src/http.rs:179— HttpRequestConfig's methods fall into 10 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 10 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CallbackInfo (LCOM4 9) layout/src/callbacks.rs:1290— CallbackInfo's methods fall into 9 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 9 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Button (LCOM4 8) layout/src/widgets/button.rs:110— Button's methods fall into 8 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 8 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ShaderContext (LCOM4 7) webrender/swgl/src/common.rs:8— ShaderContext's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CoreVideoFunctions (LCOM4 6) dll/src/desktop/shell2/macos/corevideo.rs:61— CoreVideoFunctions's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: TextArea (LCOM4 6) layout/src/widgets/text_area.rs:238— TextArea's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: TextInput (LCOM4 6) layout/src/widgets/text_input.rs:527— TextInput's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: VirtualViewCallbackInfo (LCOM4 5) core/src/callbacks.rs:472— VirtualViewCallbackInfo's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DynamicSelectorContext (LCOM4 5) css/src/dynamic_selector.rs:979— DynamicSelectorContext's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: MacOSWindow (LCOM4 5) dll/src/desktop/shell2/macos/mod.rs:4009— MacOSWindow's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RenderImageCallbackInfo (LCOM4 5) layout/src/callbacks.rs:7239— RenderImageCallbackInfo's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SlicerConfig (LCOM4 5) layout/src/solver3/display_list.rs:9490— SlicerConfig's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CheckBox (LCOM4 5) layout/src/widgets/check_box.rs:64— CheckBox's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DropDown (LCOM4 5) layout/src/widgets/drop_down.rs:73— DropDown's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ProgressBar (LCOM4 5) layout/src/widgets/progressbar.rs:206— ProgressBar's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: LocationFix (LCOM4 4) core/src/geolocation.rs:19— LocationFix's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: AndroidWindow (LCOM4 4) dll/src/desktop/shell2/android/mod.rs:75— AndroidWindow's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WaylandWindow (LCOM4 4) dll/src/desktop/shell2/linux/wayland/mod.rs:544— WaylandWindow's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ObjcLib (LCOM4 4) dll/src/desktop/shell2/macos/system_style.rs:42— ObjcLib's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DpiFunctions (LCOM4 4) dll/src/desktop/shell2/windows/dpi.rs:82— DpiFunctions's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Avatar (LCOM4 4) layout/src/widgets/avatar.rs:121— Avatar's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ListView (LCOM4 4) layout/src/widgets/list_view.rs:783— ListView's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Slider (LCOM4 4) layout/src/widgets/slider.rs:78— Slider's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Switch (LCOM4 4) layout/src/widgets/switch.rs:72— Switch's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Emitter::plan_method (cognitive 168) doc/src/codegen/v2/lang_d/wrappers.rs:1727— Emitter::plan_method has cognitive complexity 168 (threshold 15). Drivers by points: if/else 51 (114 pts), match/switch 11 (28 pts), boolean chains 22, loops 3 (4 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.
Emitter::plan_method (cognitive 157) doc/src/codegen/v2/lang_swift/wrappers.rs:1710— Emitter::plan_method has cognitive complexity 157 (threshold 15). Drivers by points: if/else 55 (104 pts), boolean chains 26, match/switch 8 (23 pts), loops 3 (4 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent 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::emit_method (cognitive 128) doc/src/codegen/v2/lang_crystal/wrappers.rs:1030— Emitter::emit_method has cognitive complexity 128 (threshold 15). Drivers by points: if/else 41 (83 pts), match/switch 6 (17 pts), boolean chains 14, loops 8 (14 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent 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::emit_string_ext (cognitive 84) doc/src/codegen/v2/lang_swift/wrappers.rs:3259— Emitter::emit_string_ext has cognitive complexity 84 (threshold 15). Drivers by points: if/else 26 (44 pts), match/switch 8 (25 pts), loops 7 (13 pts), boolean chains 2 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit_methods (cognitive 58) doc/src/codegen/v2/lang_swift/wrappers.rs:1552— Emitter::emit_methods has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (32 pts), loops 9 (14 pts), match/switch 4 (9 pts), boolean chains 3 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit_traits (cognitive 45) doc/src/codegen/v2/lang_swift/wrappers.rs:1288— Emitter::emit_traits has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 8 (16 pts), match/switch 4 (5 pts), boolean chains 3 (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.
Emitter::emit_variants (cognitive 34) doc/src/codegen/v2/lang_d/wrappers.rs:1101— Emitter::emit_variants has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (10 pts), match/switch 1 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit_option_traits (cognitive 34) doc/src/codegen/v2/lang_swift/wrappers.rs:2857— Emitter::emit_option_traits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 3 (6 pts), boolean chains 2, match/switch 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.
Emitter::emit_fields (cognitive 29) doc/src/codegen/v2/lang_crystal/wrappers.rs:762— Emitter::emit_fields has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 4 (8 pts), loops 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.
Emitter::emit_union (cognitive 27) doc/src/codegen/v2/lang_swift/wrappers.rs:757— Emitter::emit_union has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (25 pts), 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.
Emitter::emit_trampolines (cognitive 25) doc/src/codegen/v2/lang_swift/wrappers.rs:2560— Emitter::emit_trampolines has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 1 (2 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.
Emitter::emit_class (cognitive 22) doc/src/codegen/v2/lang_crystal/wrappers.rs:479— Emitter::emit_class has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 6). 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.
Emitter::method_name (cognitive 22) doc/src/codegen/v2/lang_crystal/wrappers.rs:963— Emitter::method_name has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 7 (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.
Emitter::emit_class_fields (cognitive 22) doc/src/codegen/v2/lang_swift/wrappers.rs:1191— Emitter::emit_class_fields has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (5 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.
Emitter::emit_constants (cognitive 22) doc/src/codegen/v2/lang_swift/wrappers.rs:3549— Emitter::emit_constants has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 4 (7 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit_trampolines (cognitive 20) doc/src/codegen/v2/lang_d/wrappers.rs:2513— Emitter::emit_trampolines has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (2 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.
Emitter::emit_trampolines (cognitive 19) doc/src/codegen/v2/lang_crystal/wrappers.rs:1597— Emitter::emit_trampolines has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 1 (2 pts), boolean chains 1, 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.
Emitter::emit_struct (cognitive 17) doc/src/codegen/v2/lang_d/wrappers.rs:858— Emitter::emit_struct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 1 (2 pts), match/switch 2, 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.
Emitter::emit_traits (cognitive 17) doc/src/codegen/v2/lang_d/wrappers.rs:1488— Emitter::emit_traits has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3 (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.
Emitter::emit_enums (cognitive 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:384— Emitter::emit_enums has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 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.
Emitter::emit_vec_conv (cognitive 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:1801— Emitter::emit_vec_conv has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Emitter::count (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:478— Emitter::count has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (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.
Emitter::emit_to_raw (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:909— Emitter::emit_to_raw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Emitter::emit_union_ctors (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:1111— Emitter::emit_union_ctors has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (17 lines × 2) css/src/system.rs:1792— css/src/system.rs:1792-1808 | dll/src/desktop/menu_renderer.rs:647-663 — 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) dll/src/desktop/shell2/android/mod.rs:1688— dll/src/desktop/shell2/android/mod.rs:1688-1704 | dll/src/desktop/shell2/ios/mod.rs:679-695 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4398— dll/src/desktop/shell2/linux/wayland/mod.rs:4398-4414 | dll/src/desktop/shell2/macos/events.rs:370-386 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) dll/src/desktop/shell2/macos/mod.rs:5602— dll/src/desktop/shell2/macos/mod.rs:5602-5618 | dll/src/desktop/shell2/windows/mod.rs:638-654 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 2) dll/src/desktop/tray/linux.rs:423— dll/src/desktop/tray/linux.rs:423-439 | dll/src/desktop/tray/linux.rs:783-799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/autofix/mod.rs:1986— doc/src/autofix/mod.rs:1986-2002 | doc/src/autofix/mod.rs:2109-2125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/autofix/patch_format.rs:754— doc/src/autofix/patch_format.rs:754-771 | doc/src/autofix/patch_format.rs:894-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/autofix/patch_format.rs:775— doc/src/autofix/patch_format.rs:775-791 | doc/src/autofix/patch_format.rs:914-930 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_cpp/cpp11.rs:174— doc/src/codegen/v2/lang_cpp/cpp11.rs:174-190 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1018-1034 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp20.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 590 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) doc/src/patch/mod.rs:147— doc/src/patch/mod.rs:147-163 | doc/src/patch/mod.rs:182-198 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_lisp/wrappers.rs:78— doc/src/codegen/v2/lang_lisp/wrappers.rs:78-94 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:76-92 — 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) doc/src/codegen/v2/lang_java/derives.rs:452— doc/src/codegen/v2/lang_java/derives.rs:452-468 | doc/src/codegen/v2/lang_java/derives.rs:596-612 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:1443— doc/src/codegen/v2/lang_cpp/common.rs:1443-1459 | doc/src/codegen/v2/lang_cpp/common.rs:1485-1501 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_freebasic/mod.rs:191— doc/src/codegen/v2/lang_freebasic/mod.rs:191-207 | doc/src/codegen/v2/lang_freebasic/types.rs:414-430 — 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) layout/src/cpurender/pixmap.rs:282— layout/src/cpurender/pixmap.rs:282-298 | layout/src/cpurender/pixmap.rs:463-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) layout/src/solver3/sizing.rs:2570— layout/src/solver3/sizing.rs:2570-2586 | layout/src/solver3/sizing.rs:2750-2766 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) layout/src/widgets/node_graph.rs:3501— layout/src/widgets/node_graph.rs:3501-3517 | layout/src/widgets/node_graph.rs:3573-3589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) layout/src/window.rs:2819— layout/src/window.rs:2819-2835 | layout/src/window.rs:4121-4137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) layout/src/widgets/themes/flat.rs:680— layout/src/widgets/themes/flat.rs:680-696 | layout/src/widgets/themes/flora.rs:938-957 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) webrender/core/src/picture.rs:6192— webrender/core/src/picture.rs:6192-6210 | webrender/core/src/picture.rs:6378-6394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) webrender/core/src/render_task.rs:1895— webrender/core/src/render_task.rs:1895-1911 | webrender/core/src/render_task.rs:2025-2041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:554— doc/src/codegen/v2/lang_cpp/common.rs:554-570 | doc/src/codegen/v2/lang_cpp/common.rs:972-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) dll/src/desktop/shell2/android/mod.rs:2799— dll/src/desktop/shell2/android/mod.rs:2799-2815 | dll/src/desktop/shell2/android/mod.rs:3066-3082 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/src/diff.rs:937— core/src/diff.rs:937-954 | core/src/events.rs:2239-2256 — 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) core/src/dom.rs:837— core/src/dom.rs:837-854 | core/src/dom.rs:877-894 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) css/src/system.rs:2896— css/src/system.rs:2896-2913 | css/src/system.rs:2945-2962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/common/transient.rs:256— dll/src/desktop/shell2/common/transient.rs:256-273 | dll/src/desktop/shell2/common/transient.rs:330-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:54— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:54-71 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:103-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403-420 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:503-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:2747— dll/src/desktop/shell2/linux/wayland/mod.rs:2747-2764 | dll/src/desktop/shell2/linux/wayland/mod.rs:2809-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/wr_translate2.rs:2166— dll/src/desktop/wr_translate2.rs:2166-2183 | dll/src/desktop/wr_translate2.rs:2185-2202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/web/transpiler_remill.rs:11108— dll/src/web/transpiler_remill.rs:11108-11125 | dll/src/web/transpiler_remill.rs:11128-11151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/common/debug_server/platform.rs:178— dll/src/desktop/shell2/common/debug_server/platform.rs:178-195 | dll/src/desktop/shell2/common/debug_server/platform.rs:449-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) dll/src/desktop/extra/permission/ios.rs:145— dll/src/desktop/extra/permission/ios.rs:145-162 | dll/src/desktop/extra/permission/macos.rs:246-263 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) dll/src/desktop/shell2/run.rs:644— dll/src/desktop/shell2/run.rs:644-661 | dll/src/desktop/shell2/run.rs:1997-2014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) doc/src/codegen/v2/ir.rs:1104— doc/src/codegen/v2/ir.rs:1104-1121 | doc/src/codegen/v2/ir.rs:1136-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) doc/src/codegen/v2/lang_cpp/cpp03.rs:638— doc/src/codegen/v2/lang_cpp/cpp03.rs:638-655 | doc/src/codegen/v2/lang_cpp/cpp11.rs:560-577 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) doc/src/codegen/v2/lang_java/wrappers.rs:1753— doc/src/codegen/v2/lang_java/wrappers.rs:1753-1770 | doc/src/codegen/v2/lang_java/wrappers.rs:1874-1891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) doc/src/codegen/v2/lang_rust.rs:2327— doc/src/codegen/v2/lang_rust.rs:2327-2344 | doc/src/codegen/v2/rust/shared.rs:16-33 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:803— doc/src/codegen/v2/lang_lua/wrappers.rs:803-822 | doc/src/codegen/v2/lang_lua/wrappers.rs:1267-1284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) layout/src/cpurender/svg.rs:533— layout/src/cpurender/svg.rs:533-550 | layout/src/xml/svg.rs:2055-2072 — `layout/src/cpurender/svg.rs` and `layout/src/xml/svg.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 2) layout/src/glyph_cache.rs:453— layout/src/glyph_cache.rs:453-470 | layout/src/glyph_cache.rs:587-604 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) layout/src/solver3/fc.rs:9916— layout/src/solver3/fc.rs:9916-9933 | layout/src/solver3/fc.rs:10059-10076 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) layout/src/widgets/node_graph.rs:1745— layout/src/widgets/node_graph.rs:1745-1762 | layout/src/widgets/node_graph.rs:1768-1785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) layout/src/widgets/themes/flat.rs:1345— layout/src/widgets/themes/flat.rs:1345-1362 | layout/src/widgets/themes/flora.rs:1737-1754 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) css/src/system.rs:808— css/src/system.rs:808-813 | css/src/system.rs:862-867 | css/src/system.rs:925-930 — 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) dll/src/desktop/extra/geolocation/ios.rs:211— dll/src/desktop/extra/geolocation/ios.rs:211-216 | dll/src/desktop/extra/geolocation/linux.rs:220-225 | dll/src/desktop/extra/geolocation/macos.rs:205-210 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:8360— dll/src/desktop/shell2/linux/x11/mod.rs:8360-8365 | dll/src/desktop/shell2/linux/x11/mod.rs:8389-8394 | dll/src/desktop/shell2/linux/x11/mod.rs:8520-8525 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:87— doc/src/codegen/v2/lang_csharp/wrappers.rs:87-92 | doc/src/codegen/v2/lang_java/wrappers.rs:1245-1250 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:84-89 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_kotlin/managed.rs:61— doc/src/codegen/v2/lang_kotlin/managed.rs:61-66 | doc/src/codegen/v2/lang_kotlin/managed.rs:343-348 | doc/src/codegen/v2/lang_lisp/managed.rs:135-140 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_fortran/types.rs:485— doc/src/codegen/v2/lang_fortran/types.rs:485-490 | doc/src/codegen/v2/lang_fortran/types.rs:530-535 | doc/src/codegen/v2/lang_fortran/types.rs:817-822 — 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) layout/src/cpurender/pixmap.rs:110— layout/src/cpurender/pixmap.rs:110-115 | layout/src/cpurender/pixmap.rs:294-299 | layout/src/cpurender/pixmap.rs:475-480 — 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) layout/src/cpurender/raster.rs:2965— layout/src/cpurender/raster.rs:2965-2970 | layout/src/cpurender/raster.rs:3839-3844 | layout/src/cpurender/raster.rs:4250-4255 — 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) layout/src/widgets/backstage.rs:351— layout/src/widgets/backstage.rs:351-356 | layout/src/widgets/ribbon.rs:993-998 | layout/src/widgets/ribbon.rs:1270-1275 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) layout/src/window.rs:3327— layout/src/window.rs:3327-3340 | layout/src/window.rs:3353-3361 | layout/src/window.rs:3377-3382 — 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) dll/src/desktop/extra/keyring/apple.rs:35— dll/src/desktop/extra/keyring/apple.rs:35-40 | dll/src/desktop/extra/keyring/linux.rs:177-182 | dll/src/desktop/extra/keyring/windows.rs:35-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 all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) dll/src/desktop/shell2/android/mod.rs:596— dll/src/desktop/shell2/android/mod.rs:596-601 | dll/src/desktop/shell2/ios/mod.rs:2044-2049 | dll/src/desktop/shell2/linux/wayland/mod.rs:10097-10102 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:392— doc/src/codegen/v2/lang_crystal/model.rs:392-397 | doc/src/codegen/v2/lang_d/model.rs:564-569 | doc/src/codegen/v2/lang_swift/model.rs:579-584 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1139— doc/src/codegen/v2/lang_kotlin/wrappers.rs:1139-1144 | doc/src/codegen/v2/lang_node/wrappers.rs:1865-1870 | doc/src/codegen/v2/lang_ruby/wrappers.rs:1443-1448 — 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 (6 lines × 3) doc/src/codegen/v2/lang_lua/wrappers.rs:161— doc/src/codegen/v2/lang_lua/wrappers.rs:161-166 | doc/src/codegen/v2/lang_node/types.rs:317-322 | doc/src/codegen/v2/lang_node/wrappers.rs:377-382 — 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 (6 lines × 3) layout/src/managers/biometric.rs:185— layout/src/managers/biometric.rs:185-190 | layout/src/managers/eyedropper.rs:189-194 | layout/src/managers/keyring.rs:150-155 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) layout/src/managers/biometric.rs:219— layout/src/managers/biometric.rs:219-224 | layout/src/managers/eyedropper.rs:172-177 | layout/src/managers/keyring.rs:119-124 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) layout/src/managers/biometric.rs:229— layout/src/managers/biometric.rs:229-234 | layout/src/managers/eyedropper.rs:180-185 | layout/src/managers/keyring.rs:128-133 — before extracting anything, compare `layout/src/managers/biometric.rs` and `layout/src/managers/keyring.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) dll/src/desktop/shell2/macos/menu.rs:143— dll/src/desktop/shell2/macos/menu.rs:143-148 | layout/src/managers/media_keys.rs:81-86 | layout/src/managers/media_keys.rs:103-108 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) layout/src/solver3/cache.rs:3097— layout/src/solver3/cache.rs:3097-3103 | layout/src/solver3/cache.rs:3115-3120 | layout/src/solver3/cache.rs:3184-3189 — 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) doc/src/codegen/v2/lang_crystal/wrappers.rs:1435— doc/src/codegen/v2/lang_crystal/wrappers.rs:1435-1440 | doc/src/codegen/v2/lang_d/wrappers.rs:2364-2369 | doc/src/codegen/v2/lang_swift/wrappers.rs:2341-2346 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) core/src/xml.rs:429— core/src/xml.rs:429-434 | core/src/xml.rs:513-518 | core/src/xml.rs:622-627 — 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.
LayoutWindow::layout_dom_recursive_impl (cyclomatic 89) layout/src/window.rs:5543— LayoutWindow::layout_dom_recursive_impl has cyclomatic complexity 89 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutWindow::apply_text_tweens (cyclomatic 64) layout/src/window.rs:8915— LayoutWindow::apply_text_tweens 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.
LayoutWindow::reshape_text_node (cyclomatic 59) layout/src/window.rs:17383— LayoutWindow::reshape_text_node 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.
LayoutWindow::process_accessibility_action (cyclomatic 46) layout/src/window.rs:15882— LayoutWindow::process_accessibility_action 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.
LayoutWindow::process_mouse_click_for_selection (cyclomatic 43) layout/src/window.rs:19366— LayoutWindow::process_mouse_click_for_selection 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.
LayoutWindow::begin_reconciliation (cyclomatic 36) layout/src/window.rs:10861— LayoutWindow::begin_reconciliation 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.
LayoutWindow::tick_animations (cyclomatic 35) layout/src/window.rs:11609— LayoutWindow::tick_animations 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.
LayoutWindow::layout_and_generate_display_list_impl (cyclomatic 32) layout/src/window.rs:2306— LayoutWindow::layout_and_generate_display_list_impl 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.
LayoutWindow::run_track_frames (cyclomatic 29) layout/src/window.rs:13918— LayoutWindow::run_track_frames 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.
LayoutWindow::composite_zombies_cpu (cyclomatic 26) layout/src/window.rs:25345— LayoutWindow::composite_zombies_cpu 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.
LayoutWindow::select_next_occurrence (cyclomatic 24) layout/src/window.rs:13202— LayoutWindow::select_next_occurrence 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.
LayoutWindow::apply_one_text_changeset (cyclomatic 22) layout/src/window.rs:16478— LayoutWindow::apply_one_text_changeset 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.
LayoutWindow::get_selected_content_for_clipboard (cyclomatic 21) layout/src/window.rs:20281— LayoutWindow::get_selected_content_for_clipboard 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.
LayoutWindow::finalize_pending_focus_changes (cyclomatic 20) layout/src/window.rs:9890— LayoutWindow::finalize_pending_focus_changes has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LayoutWindow::update_a11y_tree_incremental (cyclomatic 19) layout/src/window.rs:12332— LayoutWindow::update_a11y_tree_incremental 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.
LayoutWindow::apply_node_css_change (cyclomatic 18) layout/src/window.rs:7327— LayoutWindow::apply_node_css_change 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.
LayoutWindow::synchronize_scrollbar_opacity (cyclomatic 18) layout/src/window.rs:11883— LayoutWindow::synchronize_scrollbar_opacity 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.
LayoutWindow::finish_reconciliation (cyclomatic 17) layout/src/window.rs:11286— LayoutWindow::finish_reconciliation 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.
LayoutWindow::scroll_selection_into_view (cyclomatic 17) layout/src/window.rs:13589— LayoutWindow::scroll_selection_into_view 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.
LayoutWindow::remap_node_ids (cyclomatic 17) layout/src/window.rs:20900— LayoutWindow::remap_node_ids 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.
LayoutWindow::apply_seat_selection_op (cyclomatic 16) layout/src/window.rs:10474— LayoutWindow::apply_seat_selection_op 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.
webrender::prepare::prepare_interned_prim_for_render (cognitive 125) webrender/core/src/prepare.rs:316— webrender::prepare::prepare_interned_prim_for_render has cognitive complexity 125 (threshold 15). Drivers by points: if/else 32 (77 pts), loops 6 (23 pts), match/switch 7 (17 pts), boolean chains 8 (nesting depth added 72). 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.
webrender::quad::prepare_quad (cognitive 114) webrender/core/src/quad.rs:66— webrender::quad::prepare_quad has cognitive complexity 114 (threshold 15). Drivers by points: if/else 27 (62 pts), match/switch 10 (31 pts), loops 7 (16 pts), boolean chains 5 (nesting depth added 65). Of this number, 111 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
webrender::render_target::add_svg_filter_node_instances (cognitive 50) webrender/core/src/render_target.rs:1009— webrender::render_target::add_svg_filter_node_instances has cognitive complexity 50 (threshold 15). Drivers by points: match/switch 45 (46 pts), if/else 2 (3 pts), loops 1 (nesting depth added 2). 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.
webrender::prim_store::gradient::linear::optimize_linear_gradient (cognitive 42) webrender/core/src/prim_store/gradient/linear.rs:117— webrender::prim_store::gradient::linear::optimize_linear_gradient has cognitive complexity 42 (threshold 15). Drivers by points: if/else 22 (28 pts), boolean chains 10, match/switch 2 (3 pts), loops 1 (nesting depth added 7). 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.
webrender::render_target::build_mask_tasks (cognitive 39) webrender/core/src/render_target.rs:1340— webrender::render_target::build_mask_tasks has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (33 pts), loops 2 (4 pts), match/switch 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.
webrender::renderer::upload::upload_to_texture_cache (cognitive 38) webrender/core/src/renderer/upload.rs:49— webrender::renderer::upload::upload_to_texture_cache has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (21 pts), match/switch 3 (9 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 12). 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.
webrender::prim_store::gradient::radial::optimize_radial_gradient (cognitive 35) webrender/core/src/prim_store/gradient/radial.rs:387— webrender::prim_store::gradient::radial::optimize_radial_gradient has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 9 (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.
webrender::visibility::update_prim_visibility (cognitive 35) webrender/core/src/visibility.rs:139— webrender::visibility::update_prim_visibility has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 4 (10 pts), loops 3 (5 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.
webrender::border::add_corner_segment (cognitive 33) webrender/core/src/border.rs:1007— webrender::border::add_corner_segment has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (27 pts), boolean chains 3, match/switch 3 (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.
webrender::renderer::init::create_webrender_instance (cognitive 32) webrender/core/src/renderer/init.rs:296— webrender::renderer::init::create_webrender_instance has cognitive complexity 32 (threshold 15). Drivers by points: if/else 21 (23 pts), boolean chains 5, match/switch 3, 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.
webrender::border::add_segment (cognitive 21) webrender/core/src/border.rs:882— webrender::border::add_segment has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts), boolean chains 4 (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.
webrender::rectangle_occlusion::apply_occluder (cognitive 21) webrender/core/src/rectangle_occlusion.rs:149— webrender::rectangle_occlusion::apply_occluder has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 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.
webrender::picture::get_surface_rects (cognitive 20) webrender/core/src/picture.rs:8022— webrender::picture::get_surface_rects has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (7 pts), boolean chains 2, loops 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.
webrender::frame_builder::build_render_pass (cognitive 20) webrender/core/src/frame_builder.rs:956— webrender::frame_builder::build_render_pass has cognitive complexity 20 (threshold 15). Drivers by points: loops 4 (12 pts), match/switch 3 (8 pts) (nesting depth added 13). 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.
webrender::quad::get_prim_render_strategy (cognitive 20) webrender/core/src/quad.rs:708— webrender::quad::get_prim_render_strategy has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
webrender::border::write_dotted_corner_instances (cognitive 18) webrender/core/src/border.rs:369— webrender::border::write_dotted_corner_instances has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), loops 3, boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
webrender::filterdata::push_component_transfer_data (cognitive 18) webrender/core/src/filterdata.rs:161— webrender::filterdata::push_component_transfer_data has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 2 (6 pts), if/else 2 (5 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
webrender::prepare::prepare_prim_for_render (cognitive 18) webrender/core/src/prepare.rs:137— webrender::prepare::prepare_prim_for_render has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (6 pts), boolean chains 5 (nesting depth added 6). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
webrender::prepare::update_clip_task_for_brush (cognitive 18) webrender/core/src/prepare.rs:1313— webrender::prepare::update_clip_task_for_brush has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 1 (2 pts), 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.
webrender::render_task_graph::dump_render_tasks_as_svg (cognitive 16) webrender/core/src/render_task_graph.rs:856— webrender::render_task_graph::dump_render_tasks_as_svg has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 3 (7 pts) (nesting depth added 6). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
webrender::clip::polygon_contains_point (cognitive 16) webrender/core/src/clip.rs:2128— webrender::clip::polygon_contains_point has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_core::compact::apply_css_property_to_compact (cyclomatic 190) core/src/compact.rs:1305— azul_core::compact::apply_css_property_to_compact has cyclomatic complexity 190 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_core::xml::apply_xml_node_attributes (cyclomatic 55) core/src/xml.rs:5774— azul_core::xml::apply_xml_node_attributes 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::diff::reconcile_dom (cyclomatic 47) core/src/diff.rs:569— azul_core::diff::reconcile_dom has cyclomatic complexity 47 (threshold 15). Of this number, 45 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_core::compact::update_dom_declared_flags (cyclomatic 47) core/src/compact.rs:1937— azul_core::compact::update_dom_declared_flags 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.
azul_core::path_parser::parse_svg_path_d (cyclomatic 39) core/src/path_parser.rs:423— azul_core::path_parser::parse_svg_path_d 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.
azul_core::xml::analyze_node_ctor (cyclomatic 33) core/src/xml.rs:7947— azul_core::xml::analyze_node_ctor 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::diff::compute_node_changes (cyclomatic 27) core/src/diff.rs:175— azul_core::diff::compute_node_changes has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_core::prop_cache::clone_inheritable_property (cyclomatic 22) core/src/prop_cache.rs:1493— azul_core::prop_cache::clone_inheritable_property 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. This is NOT this file's highest cyclomatic complexity: CssPropertyCache::resolve_property_dependency (cyclomatic 45) 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.
azul_core::events::handle_key_down (cyclomatic 21) core/src/events.rs:5081— azul_core::events::handle_key_down 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: azul_core::events::matches_window_filter (cyclomatic 86) 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.
azul_core::xml::user_defined_render_fn (cyclomatic 21) core/src/xml.rs:2993— azul_core::xml::user_defined_render_fn 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::xml::group_matches (cyclomatic 21) core/src/xml.rs:7140— azul_core::xml::group_matches 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: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::xml::serde_impl::string_to_field_type (cyclomatic 21) core/src/xml.rs:2093— azul_core::xml::serde_impl::string_to_field_type 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::styled_dom::is_layout_equivalent (cyclomatic 20) core/src/styled_dom.rs:3281— azul_core::styled_dom::is_layout_equivalent 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.
azul_core::resources::build_add_font_resource_updates (cyclomatic 20) core/src/resources.rs:3669— azul_core::resources::build_add_font_resource_updates 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.
azul_core::diff::fingerprint_dom (cyclomatic 19) core/src/diff.rs:2325— azul_core::diff::fingerprint_dom has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 3 function items inside it that branch (node_structure_hash, node_style_hash, walk). 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.
azul_core::style::matches_html_element (cyclomatic 17) core/src/style.rs:63— azul_core::style::matches_html_element 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.
azul_core::style::match_attribute_selector (cyclomatic 17) core/src/style.rs:563— azul_core::style::match_attribute_selector 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.
azul_core::xml::user_defined_compile_fn (cyclomatic 17) core/src/xml.rs:3180— azul_core::xml::user_defined_compile_fn has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
azul_core::diff::calculate_reconciliation_key (cyclomatic 16) core/src/diff.rs:361— azul_core::diff::calculate_reconciliation_key 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.
azul_core::diff::calculate_contenteditable_key (cyclomatic 16) core/src/diff.rs:1426— azul_core::diff::calculate_contenteditable_key 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.
AttribLocations::get_loc (cognitive 64) webrender/swgl/src/shaders/cs_clip_rectangle.rs:72— AttribLocations::get_loc has cognitive complexity 64 (threshold 15). Drivers by points: if/else 48 (64 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.
AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_border_segment.rs:61— AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_border_solid.rs:58— AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
AttribLocations::get_loc (cognitive 41) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:88— AttribLocations::get_loc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 31 (41 pts) (nesting depth added 10). 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.
AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_conic_gradient.rs:49— AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 pts) (nesting depth added 9). 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.
AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_radial_gradient.rs:49— AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 pts) (nesting depth added 9). 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.
AttribLocations::get_loc (cognitive 37) webrender/swgl/src/shaders/cs_svg_filter_node.rs:53— AttribLocations::get_loc has cognitive complexity 37 (threshold 15). Drivers by points: if/else 28 (37 pts) (nesting depth added 9). 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.
AttribLocations::get_loc (cognitive 33) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:90— AttribLocations::get_loc has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (33 pts) (nesting depth added 8). 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.
AttribLocations::get_loc (cognitive 33) webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:90— AttribLocations::get_loc has cognitive complexity 33 (threshold 15). Drivers by points: if/else 25 (33 pts) (nesting depth added 8). 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.
AttribLocations::get_loc (cognitive 29) webrender/swgl/src/shaders/composite_texture_rect.rs:44— AttribLocations::get_loc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (nesting depth added 7). 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.
AttribLocations::get_loc (cognitive 29) webrender/swgl/src/shaders/cs_linear_gradient.rs:45— AttribLocations::get_loc has cognitive complexity 29 (threshold 15). Drivers by points: if/else 22 (29 pts) (nesting depth added 7). 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.
AttribLocations::get_loc (cognitive 25) webrender/swgl/src/shaders/composite_fast_path_texture_rect.rs:39— AttribLocations::get_loc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (25 pts) (nesting depth added 6). 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.
AttribLocations::get_loc (cognitive 25) webrender/swgl/src/shaders/cs_blur_alpha_target.rs:57— AttribLocations::get_loc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 19 (25 pts) (nesting depth added 6). 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.
AttribLocations::get_loc (cognitive 21) webrender/swgl/src/shaders/cs_fast_linear_gradient.rs:46— AttribLocations::get_loc has cognitive complexity 21 (threshold 15). Drivers by points: if/else 16 (21 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AttribLocations::get_loc (cognitive 19) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:106— AttribLocations::get_loc has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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.
AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/cs_scale_texture_2d.rs:39— AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 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.
AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/cs_scale_texture_rect.rs:42— AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 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.
AttribLocations::get_loc (cognitive 17) webrender/swgl/src/shaders/ps_copy.rs:35— AttribLocations::get_loc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (17 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.
AttribLocations::bind_loc (cognitive 16) webrender/swgl/src/shaders/cs_clip_rectangle.rs:52— AttribLocations::bind_loc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
AttribLocations::bind_loc (cognitive 16) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:86— AttribLocations::bind_loc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
Duplicated block (8 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5163— dll/src/desktop/shell2/linux/wayland/mod.rs:5163-5170 | dll/src/desktop/shell2/linux/wayland/mod.rs:5240-5247 | dll/src/desktop/shell2/linux/x11/mod.rs:4818-4825 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) dll/src/desktop/tray/linux.rs:480— dll/src/desktop/tray/linux.rs:480-487 | dll/src/desktop/tray/linux.rs:634-641 | dll/src/desktop/tray/linux.rs:838-845 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:520— doc/src/codegen/v2/lang_crystal/model.rs:520-527 | doc/src/codegen/v2/lang_d/model.rs:816-823 | doc/src/codegen/v2/lang_swift/model.rs:822-829 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1037— doc/src/codegen/v2/lang_crystal/wrappers.rs:1037-1044 | doc/src/codegen/v2/lang_d/wrappers.rs:1743-1750 | doc/src/codegen/v2/lang_swift/wrappers.rs:1719-1726 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_rust.rs:4666— doc/src/codegen/v2/lang_rust.rs:4666-4673 | doc/src/codegen/v2/lang_rust.rs:4702-4709 | doc/src/codegen/v2/lang_rust.rs:4734-4741 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_java/types.rs:139— doc/src/codegen/v2/lang_java/types.rs:139-146 | doc/src/codegen/v2/lang_java/types.rs:181-188 | doc/src/codegen/v2/lang_java/types.rs:277-284 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) layout/src/cpurender/pixmap.rs:1325— layout/src/cpurender/pixmap.rs:1325-1332 | layout/src/cpurender/pixmap.rs:1435-1442 | layout/src/cpurender/raster.rs:3842-3849 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8 lines × 3) layout/src/dom_lint.rs:775— layout/src/dom_lint.rs:775-782 | layout/src/dom_lint.rs:862-869 | layout/src/dom_lint.rs:1167-1174 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) layout/src/solver3/display_list.rs:1030— layout/src/solver3/display_list.rs:1030-1037 | layout/src/solver3/display_list.rs:1076-1083 | layout/src/solver3/display_list.rs:1140-1147 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) layout/src/solver3/fc.rs:8890— layout/src/solver3/fc.rs:8890-8897 | layout/src/solver3/fc.rs:9421-9431 | layout/src/solver3/fc.rs:9965-9972 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) layout/src/widgets/node_graph.rs:1482— layout/src/widgets/node_graph.rs:1482-1489 | layout/src/widgets/node_graph.rs:1791-1798 | layout/src/widgets/node_graph.rs:1818-1825 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:162— doc/src/codegen/v2/lang_csharp/wrappers.rs:162-169 | doc/src/codegen/v2/lang_java/wrappers.rs:1324-1331 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:151-158 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_haskell/functions.rs:864— doc/src/codegen/v2/lang_haskell/functions.rs:864-871 | doc/src/codegen/v2/lang_haskell/types.rs:1073-1080 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2352-2359 — 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 (8 lines × 3) core/src/xml.rs:3200— core/src/xml.rs:3200-3208 | core/src/xml.rs:3255-3264 | core/src/xml.rs:3289-3296 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) dll/src/desktop/tray/linux.rs:471— dll/src/desktop/tray/linux.rs:471-478 | dll/src/desktop/tray/linux.rs:829-836 | dll/src/desktop/tray/linux.rs:912-919 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/functions.rs:96— doc/src/codegen/v2/lang_crystal/functions.rs:96-103 | doc/src/codegen/v2/lang_odin/functions.rs:68-75 | doc/src/codegen/v2/lang_v/functions.rs:87-94 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) doc/src/codegen/v2/lang_crystal/types.rs:161— doc/src/codegen/v2/lang_crystal/types.rs:161-168 | doc/src/codegen/v2/lang_odin/types.rs:145-152 | doc/src/codegen/v2/lang_v/types.rs:150-157 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) doc/src/autofix/mod.rs:2602— doc/src/autofix/mod.rs:2602-2609 | doc/src/autofix/mod.rs:2658-2665 | doc/src/autofix/mod.rs:2694-2701 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) core/src/diff.rs:741— core/src/diff.rs:741-746 | core/src/diff.rs:787-791 | core/src/diff.rs:801-805 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) css/src/props/property.rs:1586— css/src/props/property.rs:1586-1608 | css/src/props/property.rs:1833-1867 | css/src/props/property.rs:1874-1878 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) css/src/system.rs:2539— css/src/system.rs:2539-2543 | css/src/system.rs:2590-2594 | css/src/system.rs:2640-2644 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:187— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:187-191 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:403-407 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:503-507 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) dll/src/desktop/shell2/linux/x11/events.rs:1542— dll/src/desktop/shell2/linux/x11/events.rs:1542-1546 | dll/src/desktop/shell2/linux/x11/mod.rs:8029-8033 | dll/src/desktop/shell2/windows/mod.rs:7583-7587 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/events.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:581— doc/src/codegen/v2/lang_crystal/model.rs:581-585 | doc/src/codegen/v2/lang_d/model.rs:896-900 | doc/src/codegen/v2/lang_swift/model.rs:897-901 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 3) doc/src/codegen/v2/lang_cobol/types.rs:136— doc/src/codegen/v2/lang_cobol/types.rs:136-140 | doc/src/codegen/v2/lang_cobol/types.rs:319-323 | doc/src/codegen/v2/lang_cobol/types.rs:357-361 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) layout/src/widgets/backstage.rs:356— layout/src/widgets/backstage.rs:356-360 | layout/src/widgets/ribbon.rs:998-1002 | layout/src/widgets/ribbon.rs:1180-1184 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) layout/src/widgets/backstage.rs:387— layout/src/widgets/backstage.rs:387-391 | layout/src/widgets/ribbon.rs:1046-1050 | layout/src/widgets/ribbon.rs:1094-1098 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) layout/src/widgets/ribbon.rs:949— layout/src/widgets/ribbon.rs:949-953 | layout/src/widgets/ribbon.rs:1047-1051 | layout/src/widgets/ribbon.rs:1095-1099 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) layout/src/widgets/ribbon.rs:999— layout/src/widgets/ribbon.rs:999-1003 | layout/src/widgets/ribbon.rs:1181-1185 | layout/src/widgets/ribbon.rs:1224-1228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) dll/src/desktop/shell2/android/mod.rs:602— dll/src/desktop/shell2/android/mod.rs:602-606 | dll/src/desktop/shell2/ios/mod.rs:2050-2054 | dll/src/desktop/shell2/linux/wayland/mod.rs:10104-10108 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 3) dll/src/desktop/extra/audio/mod.rs:211— dll/src/desktop/extra/audio/mod.rs:211-215 | dll/src/desktop/extra/video_codec/mod.rs:313-317 | dll/src/desktop/extra/video_codec/mod.rs:463-467 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) doc/src/codegen/v2/lang_swift/wrappers.rs:2907— doc/src/codegen/v2/lang_swift/wrappers.rs:2907-2911 | doc/src/codegen/v2/lang_swift/wrappers.rs:2929-2933 | doc/src/codegen/v2/lang_swift/wrappers.rs:2952-2958 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) doc/src/reftest/autodebug.rs:2184— doc/src/reftest/autodebug.rs:2184-2189 | doc/src/reftest/autoreview.rs:1131-1135 | doc/src/reftest/autoreview.rs:1570-1574 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) dll/src/desktop/shell2/linux/wayland/events.rs:2594— dll/src/desktop/shell2/linux/wayland/events.rs:2594-2598 | dll/src/desktop/shell2/linux/x11/mod.rs:1531-1535 | layout/src/fetch.rs:163-167 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) doc/src/autofix/type_index.rs:1117— doc/src/autofix/type_index.rs:1117-1121 | doc/src/autofix/type_index.rs:1218-1222 | doc/src/autotest/extract.rs:92-96 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) layout/src/cpurender/compositor.rs:2393— layout/src/cpurender/compositor.rs:2393-2397 | layout/src/cpurender/compositor.rs:2437-2441 | layout/src/cpurender/compositor.rs:2449-2453 — 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.
WaylandWindow::generate_frame_if_needed (cognitive 409) dll/src/desktop/shell2/linux/wayland/mod.rs:7011— WaylandWindow::generate_frame_if_needed has cognitive complexity 409 (threshold 15). Drivers by points: if/else 90 (309 pts), loops 9 (68 pts), match/switch 5 (17 pts), boolean chains 15 (nesting depth added 290). 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.
WaylandWindow::new (cognitive 99) dll/src/desktop/shell2/linux/wayland/mod.rs:1972— WaylandWindow::new has cognitive complexity 99 (threshold 15). Drivers by points: if/else 43 (78 pts), match/switch 6 (14 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WaylandWindow::wait_for_events (cognitive 58) dll/src/desktop/shell2/linux/wayland/mod.rs:2971— WaylandWindow::wait_for_events has cognitive complexity 58 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 9, loops 4 (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.
WaylandWindow::handle_pointer_button (cognitive 47) dll/src/desktop/shell2/linux/wayland/mod.rs:4438— WaylandWindow::handle_pointer_button has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (37 pts), match/switch 4 (6 pts), boolean chains 4 (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.
WaylandWindow::handle_key (cognitive 46) dll/src/desktop/shell2/linux/wayland/mod.rs:3450— WaylandWindow::handle_key has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (36 pts), boolean chains 6, match/switch 3 (4 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.
WaylandWindow::set_cursor_for (cognitive 33) dll/src/desktop/shell2/linux/wayland/mod.rs:8284— WaylandWindow::set_cursor_for has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 7 (8 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.
WaylandWindow::set_prevent_system_sleep (cognitive 33) dll/src/desktop/shell2/linux/wayland/mod.rs:10845— WaylandWindow::set_prevent_system_sleep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 5 (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.
WaylandWindow::sync_window_state (cognitive 29) dll/src/desktop/shell2/linux/wayland/mod.rs:6656— WaylandWindow::sync_window_state has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 5 (9 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.
WaylandWindow::handle_tablet_frame (cognitive 28) dll/src/desktop/shell2/linux/wayland/mod.rs:4259— WaylandWindow::handle_tablet_frame has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 8 (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.
WaylandWindow::handle_seat_pointer_button (cognitive 28) dll/src/desktop/shell2/linux/wayland/mod.rs:6124— WaylandWindow::handle_seat_pointer_button has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 4, match/switch 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.
WaylandWindow::handle_seat_key (cognitive 26) dll/src/desktop/shell2/linux/wayland/mod.rs:5312— WaylandWindow::handle_seat_key has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (21 pts), boolean chains 4, match/switch 1 (nesting depth added 11). 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.
WaylandWindow::drop (cognitive 25) dll/src/desktop/shell2/linux/wayland/mod.rs:8509— WaylandWindow::drop has cognitive complexity 25 (threshold 15). Drivers by points: if/else 22 (23 pts), loops 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WaylandWindow::send_surrounding_text (cognitive 24) dll/src/desktop/shell2/linux/wayland/mod.rs:10323— WaylandWindow::send_surrounding_text has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 1 (4 pts), loops 1 (3 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.
WaylandWindow::handle_process_event_result (cognitive 21) dll/src/desktop/shell2/linux/wayland/mod.rs:3716— WaylandWindow::handle_process_event_result has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 14). 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.
WaylandWindow::handle_tablet_frame_for_seat (cognitive 19) dll/src/desktop/shell2/linux/wayland/mod.rs:4170— WaylandWindow::handle_tablet_frame_for_seat has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WaylandWindow::dispatch_scroll_delta (cognitive 19) dll/src/desktop/shell2/linux/wayland/mod.rs:4944— WaylandWindow::dispatch_scroll_delta has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (18 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.
WaylandWindow::apply_seat_text_input_done (cognitive 17) dll/src/desktop/shell2/linux/wayland/mod.rs:10692— WaylandWindow::apply_seat_text_input_done has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 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.
TooManyFields: Wayland dll/src/desktop/shell2/linux/wayland/dlopen.rs:24— TooManyFields — 145 stored fields beside 1 method. The bar is 30 stored fields; this is 115 over it, 4.83× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WaylandWindow dll/src/desktop/shell2/linux/wayland/mod.rs:544— TooManyFields — 122 stored fields beside 132 methods. The bar is 30 stored fields; this is 92 over it, 4.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LayoutWindow layout/src/window.rs:1184— TooManyFields — 104 stored fields beside 322 methods. The bar is 30 stored fields; this is 74 over it, 3.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Xlib dll/src/desktop/shell2/linux/x11/dlopen.rs:91— TooManyFields — 84 stored fields beside 1 method. The bar is 30 stored fields; this is 54 over it, 2.80× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: User32Functions dll/src/desktop/shell2/windows/dlopen.rs:595— TooManyFields — 74 stored fields. The bar is 30 stored fields; this is 44 over it, 2.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: X11Window dll/src/desktop/shell2/linux/x11/mod.rs:2593— TooManyFields — 72 stored fields beside 84 methods. The bar is 30 stored fields; this is 42 over it, 2.40× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Renderer webrender/core/src/renderer/mod.rs:761— TooManyFields — 63 stored fields beside 86 methods. The bar is 30 stored fields; this is 33 over it, 2.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: VtLib dll/src/desktop/extra/video_codec/videotoolbox.rs:115— TooManyFields — 50 stored fields beside 1 method. The bar is 30 stored fields; this is 20 over it, 1.67× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WebRenderOptions webrender/core/src/renderer/init.rs:122— TooManyFields — 48 stored fields. The bar is 30 stored fields; this is 18 over it, 1.60× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RibbonStyle layout/src/widgets/ribbon.rs:1643— TooManyFields — 45 stored fields beside 49 methods. The bar is 30 stored fields; this is 15 over it, 1.50× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: TileCacheInstance webrender/core/src/picture.rs:1689— TooManyFields — 44 stored fields beside 18 methods. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: WaylandTheme core/src/window.rs:2046— TooManyFields — 44 stored fields. The bar is 30 stored fields; this is 14 over it, 1.47× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Device webrender/core/src/device/gl.rs:1076— TooManyFields — 40 stored fields beside 133 methods. The bar is 30 stored fields; this is 10 over it, 1.33× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Win32Window dll/src/desktop/shell2/windows/mod.rs:147— TooManyFields — 39 stored fields beside 62 methods. The bar is 30 stored fields; this is 9 over it, 1.30× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: UnifiedConstraints layout/src/text3/cache.rs:2280— TooManyFields — 37 stored fields beside 3 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Shaders webrender/core/src/renderer/shade.rs:572— TooManyFields — 35 stored fields beside 7 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: MacOSWindow dll/src/desktop/shell2/macos/mod.rs:4009— TooManyFields — 33 stored fields beside 99 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (19 lines × 2) core/src/resources.rs:2635— core/src/resources.rs:2635-2653 | core/src/resources.rs:2827-2845 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) core/src/style.rs:122— core/src/style.rs:122-140 | core/src/style.rs:166-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3349— dll/src/desktop/shell2/linux/wayland/mod.rs:3349-3367 | dll/src/desktop/shell2/linux/x11/mod.rs:4352-4370 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5032— dll/src/desktop/shell2/linux/wayland/mod.rs:5032-5050 | dll/src/desktop/shell2/macos/events.rs:673-691 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:11047— dll/src/desktop/shell2/linux/wayland/mod.rs:11047-11065 | dll/src/desktop/shell2/linux/x11/mod.rs:8798-8816 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19 lines × 2) doc/src/autofix/workspace.rs:1401— doc/src/autofix/workspace.rs:1401-1419 | doc/src/autofix/workspace.rs:1645-1663 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) doc/src/codegen/v2/lang_c.rs:1172— doc/src/codegen/v2/lang_c.rs:1172-1190 | doc/src/codegen/v2/lang_cpp/common.rs:245-263 — before extracting anything, compare `doc/src/codegen/v2/lang_c.rs` and `doc/src/codegen/v2/lang_cpp/common.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:652— doc/src/codegen/v2/lang_d/wrappers.rs:652-670 | doc/src/codegen/v2/lang_swift/wrappers.rs:485-503 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19 lines × 2) doc/src/codegen/v2/lang_rust.rs:2662— doc/src/codegen/v2/lang_rust.rs:2662-2680 | doc/src/codegen/v2/rust/shared.rs:216-234 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (19 lines × 2) doc/src/patch/index.rs:325— doc/src/patch/index.rs:325-343 | doc/src/patch/index.rs:427-445 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) doc/src/reftest/debug.rs:328— doc/src/reftest/debug.rs:328-346 | doc/src/reftest/regression.rs:1634-1652 — 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 lines × 2) doc/src/print.rs:234— doc/src/print.rs:234-252 | doc/src/print.rs:261-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) layout/src/managers/scroll_state.rs:1489— layout/src/managers/scroll_state.rs:1489-1507 | layout/src/managers/scroll_state.rs:1532-1550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) layout/src/solver3/paged_layout.rs:304— layout/src/solver3/paged_layout.rs:304-322 | layout/src/solver3/paged_layout.rs:2544-2562 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) layout/src/window.rs:2041— layout/src/window.rs:2041-2059 | layout/src/window.rs:7770-7788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) layout/src/window.rs:14447— layout/src/window.rs:14447-14465 | layout/src/window.rs:14543-14561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) webrender/core/src/frame_builder.rs:1061— webrender/core/src/frame_builder.rs:1061-1079 | webrender/core/src/render_target.rs:328-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.
X11Window::render_and_present (cognitive 177) dll/src/desktop/shell2/linux/x11/mod.rs:6380— X11Window::render_and_present has cognitive complexity 177 (threshold 15). Drivers by points: if/else 49 (136 pts), loops 3 (27 pts), boolean chains 8, match/switch 5 (6 pts) (nesting depth added 112). 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.
X11Window::handle_event (cognitive 133) dll/src/desktop/shell2/linux/x11/mod.rs:4836— X11Window::handle_event has cognitive complexity 133 (threshold 15). Drivers by points: if/else 45 (108 pts), match/switch 7 (15 pts), boolean chains 10 (nesting depth added 71). 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.
X11Window::new_with_resources (cognitive 74) dll/src/desktop/shell2/linux/x11/mod.rs:3227— X11Window::new_with_resources has cognitive complexity 74 (threshold 15). Drivers by points: if/else 33 (41 pts), match/switch 13 (27 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 24). 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.
X11Window::wait_for_events (cognitive 49) dll/src/desktop/shell2/linux/x11/mod.rs:4486— X11Window::wait_for_events has cognitive complexity 49 (threshold 15). Drivers by points: if/else 19 (34 pts), loops 4 (8 pts), boolean chains 7 (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.
X11Window::handle_mouse_button (cognitive 41) dll/src/desktop/shell2/linux/x11/events.rs:476— X11Window::handle_mouse_button has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 6, match/switch 4 (6 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.
X11Window::handle_keyboard (cognitive 41) dll/src/desktop/shell2/linux/x11/events.rs:1002— X11Window::handle_keyboard has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (26 pts), match/switch 4 (12 pts), boolean chains 3 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X11Window::close (cognitive 36) dll/src/desktop/shell2/linux/x11/mod.rs:3092— X11Window::close has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 23). 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.
X11Window::set_prevent_system_sleep (cognitive 33) dll/src/desktop/shell2/linux/x11/mod.rs:8606— X11Window::set_prevent_system_sleep has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 5 (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.
X11Window::sync_window_state (cognitive 32) dll/src/desktop/shell2/linux/x11/mod.rs:7443— X11Window::sync_window_state has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (28 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X11Window::process_pending_menu_callbacks (cognitive 29) dll/src/desktop/shell2/linux/x11/mod.rs:4340— X11Window::process_pending_menu_callbacks has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), match/switch 3 (6 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.
X11Window::handle_xdnd_client_message (cognitive 28) dll/src/desktop/shell2/linux/x11/mod.rs:5739— X11Window::handle_xdnd_client_message has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X11Window::handle_seat_key_event (cognitive 24) dll/src/desktop/shell2/linux/x11/mod.rs:1870— X11Window::handle_seat_key_event has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
X11Window::handle_scroll_input_for_seat (cognitive 22) dll/src/desktop/shell2/linux/x11/events.rs:868— X11Window::handle_scroll_input_for_seat has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (21 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.
X11Window::apply_size_to_content (cognitive 22) dll/src/desktop/shell2/linux/x11/mod.rs:6006— X11Window::apply_size_to_content has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 12). 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.
X11Window::handle_property_notify (cognitive 20) dll/src/desktop/shell2/linux/x11/mod.rs:7358— X11Window::handle_property_notify has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (7 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.
X11Window::apply_event_result (cognitive 18) dll/src/desktop/shell2/linux/x11/mod.rs:5616— X11Window::apply_event_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×16
Members sharing a duplicated core (5 members, 50+ identical tokens) core/src/resources.rs:2634— core/src/resources.rs:2634-2656 | core/src/resources.rs:2698-2717 | core/src/resources.rs:2747-2769 | core/src/resources.rs:2826-2848 | core/src/resources.rs:2894-2916 — 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) css/src/system.rs:801— css/src/system.rs:801-824 | css/src/system.rs:828-851 | css/src/system.rs:855-878 | css/src/system.rs:882-914 | css/src/system.rs:918-941 — 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) dll/src/desktop/shell2/linux/wayland/defines.rs:2066— dll/src/desktop/shell2/linux/wayland/defines.rs:2066-2125 | dll/src/desktop/shell2/linux/wayland/defines.rs:2198-2252 | dll/src/desktop/shell2/linux/wayland/defines.rs:2380-2419 | dll/src/desktop/shell2/linux/wayland/defines.rs:2890-2920 | dll/src/desktop/shell2/linux/wayland/defines.rs:3057-3087 — 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) dll/src/desktop/shell2/linux/wayland/mod.rs:7011— dll/src/desktop/shell2/linux/wayland/mod.rs:7011-8271 | dll/src/desktop/shell2/linux/x11/mod.rs:6172-6276 | dll/src/desktop/shell2/linux/x11/mod.rs:6380-7131 | dll/src/desktop/shell2/windows/mod.rs:1817-1931 | dll/src/desktop/shell2/windows/mod.rs:1944-1984 — 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) dll/src/desktop/shell2/linux/x11/mod.rs:4340— dll/src/desktop/shell2/linux/x11/mod.rs:4340-4480 | dll/src/desktop/shell2/linux/x11/mod.rs:4782-4795 | dll/src/desktop/shell2/linux/x11/mod.rs:5598-5610 | dll/src/desktop/shell2/linux/x11/mod.rs:5616-5678 | dll/src/desktop/shell2/linux/x11/mod.rs:7929-7942 — 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) dll/src/web/transpiler_remill.rs:6177— dll/src/web/transpiler_remill.rs:6177-6207 | dll/src/web/transpiler_remill.rs:10931-10981 | dll/src/web/transpiler_remill.rs:11061-11413 | dll/src/web/transpiler_remill.rs:11423-11471 | dll/src/web/transpiler_remill.rs:11474-11503 — 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) dll/src/desktop/extra/biometric/android.rs:139— dll/src/desktop/extra/biometric/android.rs:139-151 | dll/src/desktop/extra/geolocation/android.rs:108-120 | dll/src/desktop/extra/keyring/android.rs:106-118 | dll/src/desktop/extra/permission/android.rs:146-158 | dll/src/desktop/extra/sensors/android.rs:80-92 — 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) doc/src/codegen/v2/lang_crystal/mod.rs:288— doc/src/codegen/v2/lang_crystal/mod.rs:288-294 | doc/src/codegen/v2/lang_d/mod.rs:416-422 | doc/src/codegen/v2/lang_julia/mod.rs:182-188 | doc/src/codegen/v2/lang_odin/mod.rs:117-123 | doc/src/codegen/v2/lang_v/mod.rs:140-146 — 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) doc/src/codegen/v2/lang_csharp/wrappers.rs:541— doc/src/codegen/v2/lang_csharp/wrappers.rs:541-561 | doc/src/codegen/v2/lang_haskell/types.rs:466-491 | doc/src/codegen/v2/lang_java/wrappers.rs:957-977 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:370-390 | doc/src/codegen/v2/lang_ruby/wrappers.rs:630-653 — 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) doc/src/codegen/v2/lang_crystal/types.rs:324— doc/src/codegen/v2/lang_crystal/types.rs:324-386 | doc/src/codegen/v2/lang_d/types.rs:212-261 | doc/src/codegen/v2/lang_julia/types.rs:311-370 | doc/src/codegen/v2/lang_odin/types.rs:270-327 | doc/src/codegen/v2/lang_v/types.rs:278-338 — 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) doc/src/codegen/v2/lang_algol68/wrappers.rs:119— doc/src/codegen/v2/lang_algol68/wrappers.rs:119-131 | doc/src/codegen/v2/lang_cobol/wrappers.rs:87-99 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:85-97 | doc/src/codegen/v2/lang_pascal/wrappers.rs:127-139 | doc/src/codegen/v2/lang_vb6/wrappers.rs:62-74 — 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) layout/src/cpurender/pixmap.rs:1310— layout/src/cpurender/pixmap.rs:1310-1361 | layout/src/cpurender/pixmap.rs:1422-1480 | layout/src/cpurender/raster.rs:2889-2988 | layout/src/cpurender/raster.rs:3748-3900 | layout/src/cpurender/raster.rs:4161-4355 — 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) layout/src/dialogs/crash_reporter.rs:187— layout/src/dialogs/crash_reporter.rs:187-292 | layout/src/dialogs/gpu_check.rs:201-322 | layout/src/dialogs/report_problem.rs:456-568 | layout/src/dialogs/telemetry_consent.rs:189-282 | layout/src/dialogs/update_version.rs:311-420 — 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) layout/src/dialogs/crash_reporter.rs:294— layout/src/dialogs/crash_reporter.rs:294-304 | layout/src/dialogs/gpu_check.rs:383-393 | layout/src/dialogs/report_problem.rs:697-707 | layout/src/dialogs/telemetry_consent.rs:296-306 | layout/src/dialogs/update_version.rs:423-433 — 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) layout/src/widgets/breadcrumb.rs:336— layout/src/widgets/breadcrumb.rs:336-370 | layout/src/widgets/pagination.rs:500-610 | layout/src/widgets/radio_group.rs:545-598 | layout/src/widgets/segmented.rs:443-507 | layout/src/widgets/stepper.rs:567-669 — 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) layout/src/xml/svg.rs:702— layout/src/xml/svg.rs:702-725 | layout/src/xml/svg.rs:740-763 | layout/src/xml/svg.rs:953-976 | layout/src/xml/svg.rs:1018-1041 | layout/src/xml/svg.rs:1097-1119 — 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.
azul_css::parser2::new_from_str_inner (cognitive 165) css/src/parser2.rs:1465— azul_css::parser2::new_from_str_inner has cognitive complexity 165 (threshold 15). Drivers by points: if/else 40 (122 pts), loops 5 (22 pts), match/switch 6 (17 pts), boolean chains 4 (nesting depth added 110). Of this number, 160 points are the body's own statements and 5 belong to one function item 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.
azul_css::props::property::parse_combined_css_property (cognitive 59) css/src/props/property.rs:3689— azul_css::props::property::parse_combined_css_property has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (42 pts), match/switch 8 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 28). 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.
azul_css::props::style::background::parser::parse_gradient (cognitive 36) css/src/props/style/background.rs:1361— azul_css::props::style::background::parser::parse_gradient has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5 (11 pts), boolean chains 1, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
azul_css::props::basic::animation::parse_style_animation (cognitive 34) css/src/props/basic/animation.rs:2720— azul_css::props::basic::animation::parse_style_animation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (30 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.
azul_css::props::style::background::parser::get_normalized_linear_stops (cognitive 33) css/src/props/style/background.rs:1729— azul_css::props::style::background::parser::get_normalized_linear_stops has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (9 pts), match/switch 1 (2 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. This shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_radial_stops) 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.
azul_css::props::style::background::parser::get_normalized_radial_stops (cognitive 33) css/src/props/style/background.rs:1739— azul_css::props::style::background::parser::get_normalized_radial_stops has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 5 (9 pts), match/switch 1 (2 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. This shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_linear_stops) 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.
azul_css::parser2::parse_media_feature (cognitive 30) css/src/parser2.rs:1186— azul_css::parser2::parse_media_feature has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (27 pts), boolean chains 2, match/switch 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.
azul_css::system::detect_linux_desktop_env (cognitive 29) css/src/system.rs:1920— azul_css::system::detect_linux_desktop_env has cognitive complexity 29 (threshold 15). Drivers by points: if/else 24 (26 pts), boolean chains 3 (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.
azul_css::props::layout::grid::parse_grid_template_areas (cognitive 26) css/src/props/layout/grid.rs:1393— azul_css::props::layout::grid::parse_grid_template_areas has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (9 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.
azul_css::parser2::parse_declaration_resilient (cognitive 25) css/src/parser2.rs:2070— azul_css::parser2::parse_declaration_resilient has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 5 (14 pts), if/else 8 (11 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
azul_css::props::layout::grid::parse_grid_track_owned (cognitive 19) css/src/props/layout/grid.rs:490— azul_css::props::layout::grid::parse_grid_track_owned has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3 (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.
azul_css::props::style::transform::parse_style_transform (cognitive 19) css/src/props/style/transform.rs:766— azul_css::props::style::transform::parse_style_transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 6). Of this number, 17 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul_css::props::layout::dimensions::parse_calc_expression (cognitive 18) css/src/props/layout/dimensions.rs:104— azul_css::props::layout::dimensions::parse_calc_expression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 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.
azul_css::parser2::parse_media_conditions (cognitive 17) css/src/parser2.rs:1136— azul_css::parser2::parse_media_conditions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, 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.
azul_css::props::style::border::parse_border_side (cognitive 17) css/src/props/style/border.rs:386— azul_css::props::style::border::parse_border_side has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (16 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.
RustGenerator::generate_transmute_trait_impls_enum (cognitive 38) doc/src/codegen/v2/lang_rust.rs:2963— RustGenerator::generate_transmute_trait_impls_enum has cognitive complexity 38 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 5 (nesting depth added 6). 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.
RustGenerator::generate_result_convenience_methods (cognitive 37) doc/src/codegen/v2/lang_rust.rs:1387— RustGenerator::generate_result_convenience_methods has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 5 (10 pts), loops 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.
RustGenerator::generate_trait_impls (cognitive 36) doc/src/codegen/v2/lang_rust.rs:302— RustGenerator::generate_trait_impls has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (12 pts), match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustGenerator::generate_method (cognitive 30) doc/src/codegen/v2/lang_rust.rs:2116— RustGenerator::generate_method has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 8, match/switch 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustGenerator::generate_transmute_trait_impls (cognitive 24) doc/src/codegen/v2/lang_rust.rs:2733— RustGenerator::generate_transmute_trait_impls has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 8 (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.
RustGenerator::generate_method_body (cognitive 23) doc/src/codegen/v2/lang_rust.rs:4377— RustGenerator::generate_method_body has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (19 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustGenerator::generate_struct (cognitive 20) doc/src/codegen/v2/lang_rust.rs:2513— RustGenerator::generate_struct has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (14 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RustGenerator::generate_abi_derived_trait_impls (cognitive 20) doc/src/codegen/v2/lang_rust.rs:3586— RustGenerator::generate_abi_derived_trait_impls has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 7 (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.
RustGenerator::generate_auto_from_impls (cognitive 18) doc/src/codegen/v2/lang_rust.rs:1124— RustGenerator::generate_auto_from_impls has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 3 (6 pts), loops 2, match/switch 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.
RustGenerator::generate_enum (cognitive 18) doc/src/codegen/v2/lang_rust.rs:2588— RustGenerator::generate_enum has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8, loops 3 (6 pts), boolean chains 2, match/switch 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.
RustGenerator::generate_tests (cognitive 18) doc/src/codegen/v2/lang_rust.rs:4841— RustGenerator::generate_tests has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), 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.
RustGenerator::generate_functions (cognitive 16) doc/src/codegen/v2/lang_rust.rs:241— RustGenerator::generate_functions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (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.
RustGenerator::generate_vec_ref_convenience_methods (cognitive 16) doc/src/codegen/v2/lang_rust.rs:1888— RustGenerator::generate_vec_ref_convenience_methods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RustGenerator::emit_byref_twin (cognitive 16) doc/src/codegen/v2/lang_rust.rs:4565— RustGenerator::emit_byref_twin has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), match/switch 1 (3 pts), boolean chains 2, loops 1 (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.
Duplicated block (20 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:90— dll/src/desktop/extra/geolocation/ios.rs:90-109 | dll/src/desktop/extra/geolocation/macos.rs:84-103 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4980— dll/src/desktop/shell2/linux/wayland/mod.rs:4980-5002 | dll/src/desktop/shell2/linux/x11/events.rs:921-940 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) doc/src/autofix/type_index.rs:2975— doc/src/autofix/type_index.rs:2975-2994 | doc/src/autofix/type_index.rs:3030-3049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) doc/src/codegen/v2/lang_cpp/cpp11.rs:41— doc/src/codegen/v2/lang_cpp/cpp11.rs:41-60 | doc/src/codegen/v2/lang_cpp/cpp17.rs:40-59 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) doc/src/patch/mod.rs:1951— doc/src/patch/mod.rs:1951-1970 | doc/src/patch/mod.rs:1973-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.
Duplicated block (20 lines × 2) doc/src/reftest/autoreview.rs:1131— doc/src/reftest/autoreview.rs:1131-1150 | doc/src/reftest/autoreview.rs:1570-1589 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) doc/src/codegen/v2/lang_kotlin/mod.rs:221— doc/src/codegen/v2/lang_kotlin/mod.rs:221-240 | doc/src/codegen/v2/lang_red/mod.rs:377-396 — 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 (20 lines × 2) doc/src/codegen/v2/lang_perl/functions.rs:71— doc/src/codegen/v2/lang_perl/functions.rs:71-90 | doc/src/codegen/v2/lang_ruby/functions.rs:90-109 — `doc/src/codegen/v2/lang_perl/functions.rs` and `doc/src/codegen/v2/lang_ruby/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (20 lines × 2) doc/src/codegen/v2/lang_lisp/mod.rs:247— doc/src/codegen/v2/lang_lisp/mod.rs:247-266 | doc/src/codegen/v2/lang_racket/mod.rs:199-218 — 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 (20 lines × 2) layout/src/glyph_cache.rs:369— layout/src/glyph_cache.rs:369-388 | layout/src/glyph_cache.rs:521-540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) layout/src/text3/cache.rs:1481— layout/src/text3/cache.rs:1481-1500 | layout/src/text3/cache.rs:1613-1632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) layout/src/widgets/pagination.rs:285— layout/src/widgets/pagination.rs:285-304 | layout/src/widgets/segmented.rs:254-273 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) layout/src/widgets/themes/flat.rs:568— layout/src/widgets/themes/flat.rs:568-587 | layout/src/widgets/themes/flora.rs:790-809 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) dll/src/desktop/shell2/linux/system_style.rs:3149— dll/src/desktop/shell2/linux/system_style.rs:3149-3170 | dll/src/desktop/shell2/macos/system_style.rs:927-946 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
azul_css::props::property::parse_combined_css_property (cyclomatic 87) css/src/props/property.rs:3689— azul_css::props::property::parse_combined_css_property has cyclomatic complexity 87 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_css::props::property::parse_css_property (cyclomatic 195) 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.
azul_css::parser2::new_from_str_inner (cyclomatic 72) css/src/parser2.rs:1465— azul_css::parser2::new_from_str_inner has cyclomatic complexity 72 (threshold 15). Of this number, 69 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
azul_css::props::style::transform::parse_style_transform (cyclomatic 32) css/src/props/style/transform.rs:766— azul_css::props::style::transform::parse_style_transform has cyclomatic complexity 32 (threshold 15). Of this number, 31 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
azul_css::parser2::parse_media_feature (cyclomatic 30) css/src/parser2.rs:1186— azul_css::parser2::parse_media_feature 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.
azul_css::system::detect_linux_desktop_env (cyclomatic 28) css/src/system.rs:1920— azul_css::system::detect_linux_desktop_env 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.
azul_css::props::basic::animation::parse_style_animation (cyclomatic 21) css/src/props/basic/animation.rs:2720— azul_css::props::basic::animation::parse_style_animation 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.
azul_css::props::style::filter::parser::parse_style_filter (cyclomatic 21) css/src/props/style/filter.rs:707— azul_css::props::style::filter::parser::parse_style_filter 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.
azul_css::props::style::effects::parse_style_object_position (cyclomatic 18) css/src/props/style/effects.rs:944— azul_css::props::style::effects::parse_style_object_position has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_css::props::style::effects::parsers::parse_style_cursor (cyclomatic 31) 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.
azul_css::props::style::background::parser::get_normalized_linear_stops (cyclomatic 18) css/src/props/style/background.rs:1729— azul_css::props::style::background::parser::get_normalized_linear_stops 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 shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_radial_stops) 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.
azul_css::props::style::background::parser::get_normalized_radial_stops (cyclomatic 18) css/src/props/style/background.rs:1739— azul_css::props::style::background::parser::get_normalized_radial_stops 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 shape REPEATS in the file: one other method here (azul_css::props::style::background::parser::get_normalized_linear_stops) 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.
azul_css::props::style::background::parser::parse_gradient (cyclomatic 17) css/src/props/style/background.rs:1361— azul_css::props::style::background::parser::parse_gradient 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.
azul_css::props::layout::grid::parse_grid_template_areas (cyclomatic 16) css/src/props/layout/grid.rs:1393— azul_css::props::layout::grid::parse_grid_template_areas 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.
azul_css::dynamic_selector::parse_os_at_rule_content (cyclomatic 16) css/src/dynamic_selector.rs:1453— azul_css::dynamic_selector::parse_os_at_rule_content has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_css::dynamic_selector::parse_android_version (cyclomatic 24) 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.
DisplayListGenerator::paint_inline_content (cognitive 102) layout/src/solver3/display_list.rs:7603— DisplayListGenerator::paint_inline_content has cognitive complexity 102 (threshold 15). Drivers by points: if/else 29 (70 pts), boolean chains 11, match/switch 4 (11 pts), loops 6 (10 pts) (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.
DisplayListGenerator::generate_for_stacking_context (cognitive 57) layout/src/solver3/display_list.rs:4690— DisplayListGenerator::generate_for_stacking_context has cognitive complexity 57 (threshold 15). Drivers by points: if/else 27 (52 pts), loops 3, boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayListGenerator::paint_in_flow_descendants (cognitive 53) layout/src/solver3/display_list.rs:4993— DisplayListGenerator::paint_in_flow_descendants has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (49 pts), loops 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayListGenerator::paint_cursor (cognitive 45) layout/src/solver3/display_list.rs:4375— DisplayListGenerator::paint_cursor has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (30 pts), match/switch 2 (6 pts), boolean chains 5, loops 2 (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.
DisplayListGenerator::paint_node_content_inner (cognitive 45) layout/src/solver3/display_list.rs:6665— DisplayListGenerator::paint_node_content_inner has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (43 pts), boolean chains 2 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayListGenerator::paint_collapsed_table_borders (cognitive 43) layout/src/solver3/display_list.rs:6372— DisplayListGenerator::paint_collapsed_table_borders has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 5 (12 pts), loops 7 (11 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DisplayListGenerator::paint_node_background_and_border_inner (cognitive 40) layout/src/solver3/display_list.rs:5889— DisplayListGenerator::paint_node_background_and_border_inner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 20 (31 pts), loops 2 (5 pts), boolean chains 4 (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.
DisplayListGenerator::maybe_paint_placeholder_prompt (cognitive 40) layout/src/solver3/display_list.rs:6892— DisplayListGenerator::maybe_paint_placeholder_prompt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 3 (4 pts), boolean chains 3, match/switch 1 (2 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.
DisplayListGenerator::paint_selections (cognitive 36) layout/src/solver3/display_list.rs:4091— DisplayListGenerator::paint_selections has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (12 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 22). 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.
DisplayListGenerator::paint_scrollbars (cognitive 35) layout/src/solver3/display_list.rs:7128— DisplayListGenerator::paint_scrollbars has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (31 pts), boolean chains 4 (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.
DisplayListGenerator::paint_table_items (cognitive 23) layout/src/solver3/display_list.rs:6217— DisplayListGenerator::paint_table_items has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (10 pts), match/switch 1 (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.
DisplayListGenerator::paint_table_row_and_cells (cognitive 23) layout/src/solver3/display_list.rs:6552— DisplayListGenerator::paint_table_row_and_cells has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (6 pts), boolean chains 1 (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.
DisplayListGenerator::push_node_clips (cognitive 18) layout/src/solver3/display_list.rs:5545— DisplayListGenerator::push_node_clips has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 8 (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.
Duplicated block (9 lines × 3) core/src/resources.rs:2734— core/src/resources.rs:2734-2742 | core/src/resources.rs:2793-2801 | core/src/resources.rs:2944-2952 — 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 (9 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:4637— dll/src/desktop/shell2/linux/wayland/mod.rs:4637-4645 | dll/src/desktop/shell2/linux/wayland/mod.rs:5666-5674 | dll/src/desktop/shell2/linux/wayland/mod.rs:5844-5852 — 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 (9 lines × 3) dll/src/web/symbol_table.rs:1775— dll/src/web/symbol_table.rs:1775-1783 | dll/src/web/symbol_table.rs:3105-3113 | dll/src/web/symbol_table.rs:3175-3183 — 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 (9 lines × 3) dll/src/web/transpiler_remill.rs:6181— dll/src/web/transpiler_remill.rs:6181-6189 | dll/src/web/transpiler_remill.rs:10932-10940 | dll/src/web/transpiler_remill.rs:11475-11483 — 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 (9 lines × 3) dll/src/web/transpiler_remill.rs:10933— dll/src/web/transpiler_remill.rs:10933-10941 | dll/src/web/transpiler_remill.rs:11064-11072 | dll/src/web/transpiler_remill.rs:11427-11435 — 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 (9 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:565— doc/src/codegen/v2/lang_crystal/model.rs:565-573 | doc/src/codegen/v2/lang_d/model.rs:871-879 | doc/src/codegen/v2/lang_swift/model.rs:872-880 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1018— doc/src/codegen/v2/lang_crystal/wrappers.rs:1018-1026 | doc/src/codegen/v2/lang_d/wrappers.rs:2305-2313 | doc/src/codegen/v2/lang_swift/wrappers.rs:2284-2292 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:464— doc/src/codegen/v2/lang_node/wrappers.rs:464-472 | doc/src/codegen/v2/lang_node/wrappers.rs:681-689 | doc/src/codegen/v2/lang_node/wrappers.rs:1153-1161 — 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 (9 lines × 3) layout/src/solver3/paged_layout.rs:492— layout/src/solver3/paged_layout.rs:492-500 | layout/src/solver3/paged_layout.rs:730-738 | layout/src/solver3/paged_layout.rs:797-805 — 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 (9 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:417— doc/src/codegen/v2/lang_crystal/model.rs:417-425 | doc/src/codegen/v2/lang_d/model.rs:589-597 | doc/src/codegen/v2/lang_swift/model.rs:604-612 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) core/src/xml.rs:3258— core/src/xml.rs:3258-3268 | core/src/xml.rs:3292-3300 | core/src/xml.rs:3326-3336 — 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 (9 lines × 3) doc/src/autofix/workspace.rs:1117— doc/src/autofix/workspace.rs:1117-1125 | doc/src/autofix/workspace.rs:1136-1144 | doc/src/autofix/workspace.rs:1222-1231 — 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 (9 lines × 3) doc/src/codegen/v2/lang_crystal/types.rs:354— doc/src/codegen/v2/lang_crystal/types.rs:354-362 | doc/src/codegen/v2/lang_odin/types.rs:300-308 | doc/src/codegen/v2/lang_v/types.rs:310-318 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 52 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:7526— dll/src/desktop/shell2/linux/wayland/mod.rs:7526-7532 | dll/src/desktop/shell2/linux/x11/mod.rs:6583-6589 | dll/src/desktop/shell2/macos/mod.rs:8081-8087 | dll/src/desktop/shell2/windows/mod.rs:1199-1205 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 4) doc/src/autofix/type_index.rs:2027— doc/src/autofix/type_index.rs:2027-2033 | doc/src/autofix/type_index.rs:2045-2051 | doc/src/autofix/type_index.rs:2204-2210 | doc/src/autofix/type_index.rs:2240-2246 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:38— doc/src/codegen/v2/lang_cpp/cpp03.rs:38-50 | doc/src/codegen/v2/lang_cpp/cpp11.rs:38-52 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-38 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-50 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_csharp/types.rs:430— doc/src/codegen/v2/lang_csharp/types.rs:430-436 | doc/src/codegen/v2/lang_csharp/types.rs:466-472 | doc/src/codegen/v2/lang_kotlin/mod.rs:496-502 | doc/src/codegen/v2/lang_kotlin/mod.rs:533-539 — before extracting anything, compare `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_kotlin/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) layout/src/widgets/alert.rs:258— layout/src/widgets/alert.rs:258-264 | layout/src/widgets/badge.rs:163-169 | layout/src/widgets/chip.rs:273-279 | layout/src/widgets/toast.rs:281-287 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) layout/src/widgets/quick_access.rs:364— layout/src/widgets/quick_access.rs:364-370 | layout/src/widgets/quick_access.rs:407-413 | layout/src/widgets/statusbar.rs:427-433 | layout/src/widgets/statusbar.rs:466-472 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/statusbar.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:1660— dll/src/desktop/shell2/linux/wayland/mod.rs:1660-1666 | dll/src/desktop/shell2/linux/x11/mod.rs:7921-7927 | dll/src/desktop/shell2/macos/mod.rs:4415-4421 | dll/src/desktop/shell2/windows/mod.rs:7437-7443 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_csharp/managed.rs:800— doc/src/codegen/v2/lang_csharp/managed.rs:800-806 | doc/src/codegen/v2/lang_java/managed.rs:393-399 | doc/src/codegen/v2/lang_kotlin/managed.rs:958-964 | doc/src/codegen/v2/lang_node/managed.rs:753-759 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_ada/wrappers.rs:101— doc/src/codegen/v2/lang_ada/wrappers.rs:101-107 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:251-257 | doc/src/codegen/v2/lang_perl/wrappers.rs:71-77 | doc/src/codegen/v2/lang_ruby/wrappers.rs:251-257 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (7 lines × 4) layout/src/widgets/quick_access.rs:684— layout/src/widgets/quick_access.rs:684-690 | layout/src/widgets/ribbon.rs:2823-2829 | layout/src/widgets/ribbon.rs:3024-3030 | layout/src/widgets/statusbar.rs:1059-1065 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) layout/src/managers/geolocation.rs:307— layout/src/managers/geolocation.rs:307-313 | layout/src/managers/geolocation.rs:326-332 | layout/src/managers/hid.rs:80-86 | layout/src/managers/sensors.rs:188-194 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 4) doc/src/codegen/v2/lang_freebasic/functions.rs:123— doc/src/codegen/v2/lang_freebasic/functions.rs:123-131 | doc/src/codegen/v2/lang_freebasic/types.rs:368-374 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:434-440 | doc/src/codegen/v2/lang_pascal/functions.rs:178-184 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) doc/src/main.rs:1807— doc/src/main.rs:1807-1813 | doc/src/main.rs:1818-1824 | doc/src/main.rs:1830-1836 | doc/src/main.rs:1842-1848 — 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.
WaylandWindow::generate_frame_if_needed (cyclomatic 104) dll/src/desktop/shell2/linux/wayland/mod.rs:7011— WaylandWindow::generate_frame_if_needed has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WaylandWindow::set_cursor_for (cyclomatic 55) dll/src/desktop/shell2/linux/wayland/mod.rs:8284— WaylandWindow::set_cursor_for has cyclomatic complexity 55 (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.
WaylandWindow::new (cyclomatic 48) dll/src/desktop/shell2/linux/wayland/mod.rs:1972— WaylandWindow::new 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.
WaylandWindow::handle_pointer_button (cyclomatic 36) dll/src/desktop/shell2/linux/wayland/mod.rs:4438— WaylandWindow::handle_pointer_button 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.
WaylandWindow::wait_for_events (cyclomatic 35) dll/src/desktop/shell2/linux/wayland/mod.rs:2971— WaylandWindow::wait_for_events 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.
WaylandWindow::handle_key (cyclomatic 28) dll/src/desktop/shell2/linux/wayland/mod.rs:3450— WaylandWindow::handle_key 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.
WaylandWindow::drop (cyclomatic 25) dll/src/desktop/shell2/linux/wayland/mod.rs:8509— WaylandWindow::drop 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.
WaylandWindow::handle_tablet_frame (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:4259— WaylandWindow::handle_tablet_frame 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.
WaylandWindow::handle_seat_pointer_button (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:6124— WaylandWindow::handle_seat_pointer_button 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.
WaylandWindow::sync_window_state (cyclomatic 20) dll/src/desktop/shell2/linux/wayland/mod.rs:6656— WaylandWindow::sync_window_state 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.
WaylandWindow::set_prevent_system_sleep (cyclomatic 18) dll/src/desktop/shell2/linux/wayland/mod.rs:10845— WaylandWindow::set_prevent_system_sleep 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.
WaylandWindow::handle_seat_key (cyclomatic 16) dll/src/desktop/shell2/linux/wayland/mod.rs:5312— WaylandWindow::handle_seat_key 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.
AttribLocations::get_loc (cyclomatic 33) webrender/swgl/src/shaders/cs_clip_rectangle.rs:72— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_border_segment.rs:61— AttribLocations::get_loc has cyclomatic complexity 21 (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.
AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_border_solid.rs:58— AttribLocations::get_loc has cyclomatic complexity 21 (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.
AttribLocations::get_loc (cyclomatic 21) webrender/swgl/src/shaders/cs_clip_box_shadow_texture_2d.rs:88— AttribLocations::get_loc has cyclomatic complexity 21 (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.
AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_conic_gradient.rs:49— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_radial_gradient.rs:49— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 19) webrender/swgl/src/shaders/cs_svg_filter_node.rs:53— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 18) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:106— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 17) webrender/swgl/src/shaders/composite_texture_2d_yuv.rs:90— AttribLocations::get_loc 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.
AttribLocations::get_loc (cyclomatic 17) webrender/swgl/src/shaders/composite_texture_rect_yuv.rs:90— AttribLocations::get_loc 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.
AttribLocations::bind_loc (cyclomatic 17) webrender/swgl/src/shaders/cs_clip_rectangle.rs:52— AttribLocations::bind_loc 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.
AttribLocations::bind_loc (cyclomatic 17) webrender/swgl/src/shaders/cs_clip_rectangle_fast_path.rs:86— AttribLocations::bind_loc 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.
Duplicated block (12–13 lines × 2) dll/src/desktop/extra/pdf/mod.rs:629— dll/src/desktop/extra/pdf/mod.rs:629-640 | dll/src/desktop/extra/pdf/mod.rs:700-712 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/shell2/common/event.rs:7844— dll/src/desktop/shell2/common/event.rs:7844-7856 | dll/src/desktop/shell2/common/event.rs:7946-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 (12–13 lines × 2) dll/src/desktop/shell2/windows/mod.rs:5878— dll/src/desktop/shell2/windows/mod.rs:5878-5890 | dll/src/desktop/shell2/windows/mod.rs:5995-6006 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/tray/linux.rs:633— dll/src/desktop/tray/linux.rs:633-644 | dll/src/desktop/tray/linux.rs:836-848 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/compositor2.rs:374— dll/src/desktop/compositor2.rs:374-386 | dll/src/desktop/compositor2.rs:389-400 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/compositor2.rs:1633— dll/src/desktop/compositor2.rs:1633-1644 | dll/src/desktop/compositor2.rs:1941-1953 — both copies are in the same file, so extract the 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–13 lines × 2) doc/src/autofix/type_index.rs:1858— doc/src/autofix/type_index.rs:1858-1870 | doc/src/patch/index.rs:1687-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.
Duplicated block (12–13 lines × 2) doc/src/autofix/type_index.rs:1902— doc/src/autofix/type_index.rs:1902-1914 | doc/src/autofix/type_index.rs:1959-1970 — both copies are in the same file, so extract the 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–13 lines × 2) doc/src/codegen/v2/lang_python.rs:1836— doc/src/codegen/v2/lang_python.rs:1836-1848 | doc/src/codegen/v2/lang_python.rs:1854-1865 — both copies are in the same file, so extract the 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–13 lines × 2) layout/src/solver3/getters.rs:6767— layout/src/solver3/getters.rs:6767-6779 | layout/src/solver3/getters.rs:6889-6900 — both copies are in the same file, so extract the 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–13 lines × 2) layout/src/text3/cache.rs:7224— layout/src/text3/cache.rs:7224-7235 | layout/src/text3/dense.rs:765-777 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) layout/src/text3/edit.rs:842— layout/src/text3/edit.rs:842-853 | layout/src/text3/edit.rs:975-987 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 3) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:225— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:225-234 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:352-361 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:438-447 — 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) dll/src/desktop/shell2/windows/mod.rs:2289— dll/src/desktop/shell2/windows/mod.rs:2289-2298 | dll/src/desktop/shell2/windows/mod.rs:2918-2927 | dll/src/desktop/shell2/windows/mod.rs:2973-2982 — 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) doc/src/autofix/type_index.rs:2037— doc/src/autofix/type_index.rs:2037-2046 | doc/src/autofix/type_index.rs:2055-2065 | doc/src/autofix/type_index.rs:2074-2083 — 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) doc/src/autofix/workspace.rs:1098— doc/src/autofix/workspace.rs:1098-1107 | doc/src/autofix/workspace.rs:1117-1126 | doc/src/autofix/workspace.rs:1136-1145 — 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) doc/src/codegen/v2/lang_haskell/wrappers.rs:1395— doc/src/codegen/v2/lang_haskell/wrappers.rs:1395-1404 | doc/src/codegen/v2/lang_node/managed.rs:149-161 | doc/src/codegen/v2/lang_ruby/managed.rs:497-508 — 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) doc/src/codegen/v2/lang_crystal/functions.rs:38— doc/src/codegen/v2/lang_crystal/functions.rs:38-47 | doc/src/codegen/v2/lang_julia/functions.rs:33-42 | doc/src/codegen/v2/lang_v/functions.rs:38-47 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 3) layout/src/widgets/alert.rs:343— layout/src/widgets/alert.rs:343-352 | layout/src/widgets/chip.rs:313-322 | layout/src/widgets/toast.rs:376-385 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) layout/src/window.rs:14459— layout/src/window.rs:14459-14468 | layout/src/window.rs:14555-14564 | layout/src/window.rs:14715-14724 — 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) layout/src/xml/svg.rs:1868— layout/src/xml/svg.rs:1868-1877 | layout/src/xml/svg.rs:1885-1894 | layout/src/xml/svg.rs:1909-1918 — 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) core/src/xml.rs:3081— core/src/xml.rs:3081-3090 | core/src/xml.rs:3094-3103 | core/src/xml.rs:3107-3121 — 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) doc/src/reftest/autodebug.rs:2246— doc/src/reftest/autodebug.rs:2246-2258 | doc/src/reftest/autoreview.rs:1189-1198 | doc/src/reftest/autoreview.rs:1628-1637 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) doc/src/codegen/v2/lang_csharp/mod.rs:232— doc/src/codegen/v2/lang_csharp/mod.rs:232-242 | doc/src/codegen/v2/lang_java/mod.rs:261-272 | doc/src/codegen/v2/lang_node/mod.rs:1005-1014 — 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 (9–10 lines × 2) css/src/props/layout/dimensions.rs:159— css/src/props/layout/dimensions.rs:159-167 | css/src/props/layout/dimensions.rs:175-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10264— dll/src/desktop/shell2/linux/wayland/mod.rs:10264-10273 | dll/src/desktop/shell2/linux/wayland/mod.rs:10558-10566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_c.rs:528— doc/src/codegen/v2/lang_c.rs:528-536 | doc/src/codegen/v2/lang_c.rs:788-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/reftest/autodebug.rs:1091— doc/src/reftest/autodebug.rs:1091-1100 | doc/src/reftest/autodebug.rs:1119-1127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/main.rs:974— doc/src/main.rs:974-983 | doc/src/main.rs:1221-1229 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_kotlin/mod.rs:758— doc/src/codegen/v2/lang_kotlin/mod.rs:758-767 | doc/src/codegen/v2/lang_kotlin/mod.rs:1126-1134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_v/types.rs:207— doc/src/codegen/v2/lang_v/types.rs:207-216 | doc/src/codegen/v2/lang_v/types.rs:301-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:718— doc/src/codegen/v2/lang_go/wrappers.rs:718-727 | doc/src/codegen/v2/lang_go/wrappers.rs:794-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.
Duplicated block (9–10 lines × 2) layout/src/cpurender/pixmap.rs:819— layout/src/cpurender/pixmap.rs:819-827 | layout/src/cpurender/pixmap.rs:866-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) layout/src/probe.rs:2575— layout/src/probe.rs:2575-2583 | layout/src/probe.rs:2605-2614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) layout/src/widgets/node_graph.rs:1464— layout/src/widgets/node_graph.rs:1464-1472 | layout/src/widgets/node_graph.rs:1900-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) layout/src/widgets/titlebar.rs:227— layout/src/widgets/titlebar.rs:227-235 | layout/src/widgets/titlebar.rs:301-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
webrender::render_target::add_svg_filter_node_instances (cyclomatic 101) webrender/core/src/render_target.rs:1009— webrender::render_target::add_svg_filter_node_instances has cyclomatic complexity 101 (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.
webrender::prepare::prepare_interned_prim_for_render (cyclomatic 64) webrender/core/src/prepare.rs:316— webrender::prepare::prepare_interned_prim_for_render 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.
webrender::quad::prepare_quad (cyclomatic 52) webrender/core/src/quad.rs:66— webrender::quad::prepare_quad has cyclomatic complexity 52 (threshold 15). Of this number, 50 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
webrender::prim_store::gradient::linear::optimize_linear_gradient (cyclomatic 33) webrender/core/src/prim_store/gradient/linear.rs:117— webrender::prim_store::gradient::linear::optimize_linear_gradient 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.
webrender::renderer::upload::upload_to_texture_cache (cyclomatic 28) webrender/core/src/renderer/upload.rs:49— webrender::renderer::upload::upload_to_texture_cache 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.
webrender::prim_store::gradient::radial::optimize_radial_gradient (cyclomatic 27) webrender/core/src/prim_store/gradient/radial.rs:387— webrender::prim_store::gradient::radial::optimize_radial_gradient 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.
webrender::renderer::init::create_webrender_instance (cyclomatic 26) webrender/core/src/renderer/init.rs:296— webrender::renderer::init::create_webrender_instance has cyclomatic complexity 26 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
webrender::border::add_corner_segment (cyclomatic 24) webrender/core/src/border.rs:1007— webrender::border::add_corner_segment 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.
webrender::prepare::update_clip_task_for_brush (cyclomatic 19) webrender/core/src/prepare.rs:1313— webrender::prepare::update_clip_task_for_brush 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.
webrender::prepare::prepare_prim_for_render (cyclomatic 17) webrender/core/src/prepare.rs:137— webrender::prepare::prepare_prim_for_render has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
webrender::visibility::update_prim_visibility (cyclomatic 16) webrender/core/src/visibility.rs:139— webrender::visibility::update_prim_visibility 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.
Emitter::plan_method (cyclomatic 88) doc/src/codegen/v2/lang_swift/wrappers.rs:1710— Emitter::plan_method has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent 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::plan_method (cyclomatic 82) doc/src/codegen/v2/lang_d/wrappers.rs:1727— Emitter::plan_method has cyclomatic complexity 82 (threshold 15). To reduce it, separate the cases: extract each independent 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::emit_method (cyclomatic 62) doc/src/codegen/v2/lang_crystal/wrappers.rs:1030— Emitter::emit_method has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent 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::emit_string_ext (cyclomatic 42) doc/src/codegen/v2/lang_swift/wrappers.rs:3259— Emitter::emit_string_ext 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.
Emitter::emit_traits (cyclomatic 34) doc/src/codegen/v2/lang_swift/wrappers.rs:1288— Emitter::emit_traits has cyclomatic complexity 34 (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::emit_methods (cyclomatic 31) doc/src/codegen/v2/lang_swift/wrappers.rs:1552— Emitter::emit_methods 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.
Emitter::emit_accessor (cyclomatic 23) doc/src/codegen/v2/lang_d/wrappers.rs:1300— Emitter::emit_accessor has cyclomatic complexity 23 (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.
Emitter::emit_option_traits (cyclomatic 23) doc/src/codegen/v2/lang_swift/wrappers.rs:2857— Emitter::emit_option_traits 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.
Emitter::method_name (cyclomatic 17) doc/src/codegen/v2/lang_crystal/wrappers.rs:963— Emitter::method_name 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.
Emitter::emit_class (cyclomatic 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:479— Emitter::emit_class 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.
Emitter::emit_fields (cyclomatic 16) doc/src/codegen/v2/lang_crystal/wrappers.rs:762— Emitter::emit_fields 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.
Renderer::draw_frame (cognitive 63) webrender/core/src/renderer/mod.rs:4534— Renderer::draw_frame has cognitive complexity 63 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 7 (16 pts), match/switch 3 (10 pts) (nesting depth added 38). 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.
Renderer::update (cognitive 56) webrender/core/src/renderer/mod.rs:984— Renderer::update has cognitive complexity 56 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 4 (11 pts), match/switch 3 (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.
Renderer::render_impl (cognitive 53) webrender/core/src/renderer/mod.rs:1417— Renderer::render_impl has cognitive complexity 53 (threshold 15). Drivers by points: if/else 29 (45 pts), match/switch 3 (5 pts), loops 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Renderer::update_texture_cache (cognitive 49) webrender/core/src/renderer/mod.rs:1796— Renderer::update_texture_cache has cognitive complexity 49 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 7 (15 pts), match/switch 4 (12 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Renderer::draw_alpha_batch_container (cognitive 33) webrender/core/src/renderer/mod.rs:2837— Renderer::draw_alpha_batch_container has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (4 pts), match/switch 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.
Renderer::calculate_dirty_rects (cognitive 33) webrender/core/src/renderer/mod.rs:4324— Renderer::calculate_dirty_rects has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 1 (3 pts), boolean chains 1, match/switch 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.
Renderer::save_capture (cognitive 32) webrender/core/src/renderer/mod.rs:5683— Renderer::save_capture has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 4 (16 pts), if/else 6 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 18). 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.
Renderer::draw_texture_cache_target (cognitive 25) webrender/core/src/renderer/mod.rs:3949— Renderer::draw_texture_cache_target has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 2, loops 1 (2 pts), match/switch 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.
Renderer::draw_color_target (cognitive 21) webrender/core/src/renderer/mod.rs:3568— Renderer::draw_color_target has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), loops 3, match/switch 2 (3 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Renderer::load_capture (cognitive 20) webrender/core/src/renderer/mod.rs:5839— Renderer::load_capture has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (9 pts), match/switch 3 (8 pts), if/else 3 (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.
Renderer::composite_simple (cognitive 17) webrender/core/src/renderer/mod.rs:3419— Renderer::composite_simple has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (3 pts), boolean chains 1, 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.
Duplicated block (21 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:183— dll/src/desktop/extra/geolocation/ios.rs:183-203 | dll/src/desktop/extra/geolocation/macos.rs:177-197 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) dll/src/desktop/shell2/linux/system_style.rs:3182— dll/src/desktop/shell2/linux/system_style.rs:3182-3202 | dll/src/desktop/shell2/macos/system_style.rs:956-976 — `dll/src/desktop/shell2/linux/system_style.rs` and `dll/src/desktop/shell2/macos/system_style.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 50 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3380— dll/src/desktop/shell2/linux/wayland/mod.rs:3380-3400 | dll/src/desktop/shell2/linux/x11/mod.rs:4382-4402 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21 lines × 2) dll/src/desktop/shell2/macos/events.rs:1526— dll/src/desktop/shell2/macos/events.rs:1526-1546 | dll/src/desktop/shell2/windows/mod.rs:3491-3511 — before extracting anything, compare `dll/src/desktop/shell2/macos/events.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) doc/src/autofix/workspace.rs:1734— doc/src/autofix/workspace.rs:1734-1754 | doc/src/autofix/workspace.rs:1786-1806 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:238— doc/src/codegen/v2/lang_csharp/wrappers.rs:238-258 | doc/src/codegen/v2/lang_csharp/wrappers.rs:306-326 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) doc/src/main.rs:645— doc/src/main.rs:645-665 | doc/src/main.rs:682-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) layout/src/text3/cache.rs:7149— layout/src/text3/cache.rs:7149-7169 | layout/src/text3/dense.rs:425-445 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) webrender/core/src/batch.rs:2451— webrender/core/src/batch.rs:2451-2471 | webrender/core/src/batch.rs:2583-2603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) dll/src/desktop/shell2/macos/mod.rs:6284— dll/src/desktop/shell2/macos/mod.rs:6284-6305 | dll/src/desktop/shell2/windows/mod.rs:2304-2324 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21 lines × 2) doc/src/autofix/workspace.rs:2109— doc/src/autofix/workspace.rs:2109-2129 | doc/src/autofix/workspace.rs:2160-2180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) dll/src/desktop/extra/screencap/linux.rs:587— dll/src/desktop/extra/screencap/linux.rs:587-603 | dll/src/desktop/extra/screencap/linux.rs:660-675 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:846— dll/src/desktop/shell2/linux/wayland/events.rs:846-862 | dll/src/desktop/shell2/linux/wayland/events.rs:1258-1273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3717— dll/src/desktop/shell2/linux/wayland/mod.rs:3717-3732 | dll/src/desktop/shell2/windows/mod.rs:2014-2030 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4589— dll/src/desktop/shell2/linux/wayland/mod.rs:4589-4605 | dll/src/desktop/shell2/linux/x11/events.rs:680-695 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:8768— dll/src/desktop/shell2/linux/wayland/mod.rs:8768-8784 | dll/src/desktop/shell2/linux/wayland/tooltip.rs:286-301 — 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 (16–17 lines × 2) doc/src/codegen/v2/lang_node/managed.rs:144— doc/src/codegen/v2/lang_node/managed.rs:144-160 | doc/src/codegen/v2/lang_ruby/managed.rs:492-507 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16–17 lines × 2) doc/src/reftest/autoreview.rs:1104— doc/src/reftest/autoreview.rs:1104-1119 | doc/src/reftest/autoreview.rs:1540-1556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) doc/src/reftest/regression.rs:2499— doc/src/reftest/regression.rs:2499-2515 | doc/src/reftest/regression.rs:2606-2621 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) layout/src/solver3/cache.rs:1937— layout/src/solver3/cache.rs:1937-1953 | layout/src/solver3/cache.rs:2195-2210 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) layout/src/widgets/text_area.rs:721— layout/src/widgets/text_area.rs:721-736 | layout/src/widgets/text_input.rs:1101-1117 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) layout/src/widgets/text_area.rs:780— layout/src/widgets/text_area.rs:780-795 | layout/src/widgets/text_input.rs:1171-1187 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) core/src/resources.rs:2731— core/src/resources.rs:2731-2741 | core/src/resources.rs:2790-2800 | core/src/resources.rs:2806-2816 — 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 lines × 3) doc/src/autofix/function_diff.rs:777— doc/src/autofix/function_diff.rs:777-787 | doc/src/autofix/function_diff.rs:805-815 | doc/src/autofix/function_diff.rs:823-833 — 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 lines × 3) doc/src/codegen/v2/lang_c.rs:1177— doc/src/codegen/v2/lang_c.rs:1177-1187 | doc/src/codegen/v2/lang_cpp/common.rs:250-260 | doc/src/codegen/v2/lang_haskell/cshim.rs:503-513 — before extracting anything, compare `doc/src/codegen/v2/lang_c.rs` and `doc/src/codegen/v2/lang_cpp/common.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:255— doc/src/codegen/v2/lang_cpp/cpp03.rs:255-265 | doc/src/codegen/v2/lang_cpp/cpp11.rs:164-174 | doc/src/codegen/v2/lang_cpp/cpp17.rs:295-305 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) layout/src/cpurender/pixmap.rs:1557— layout/src/cpurender/pixmap.rs:1557-1567 | layout/src/cpurender/pixmap.rs:1615-1625 | layout/src/cpurender/pixmap.rs:1650-1660 — 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 lines × 3) layout/src/widgets/ribbon.rs:846— layout/src/widgets/ribbon.rs:846-856 | layout/src/widgets/ribbon.rs:877-887 | layout/src/widgets/ribbon.rs:910-920 — 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 lines × 3) layout/src/window.rs:4812— layout/src/window.rs:4812-4822 | layout/src/window.rs:4984-4994 | layout/src/window.rs:5148-5158 — 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 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:308— doc/src/codegen/v2/lang_cpp/cpp11.rs:308-318 | doc/src/codegen/v2/lang_cpp/cpp17.rs:488-498 | doc/src/codegen/v2/lang_cpp/cpp20.rs:174-184 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) doc/src/codegen/v2/lang_rust.rs:4084— doc/src/codegen/v2/lang_rust.rs:4084-4094 | doc/src/codegen/v2/lang_rust.rs:4106-4116 | doc/src/codegen/v2/lang_rust.rs:4133-4143 — 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 lines × 3) webrender/core/src/render_backend.rs:1678— webrender/core/src/render_backend.rs:1678-1688 | webrender/core/src/render_backend.rs:1690-1700 | webrender/core/src/render_backend.rs:1702-1712 — 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 lines × 3) dll/src/desktop/shell2/linux/wayland/screencopy.rs:79— dll/src/desktop/shell2/linux/wayland/screencopy.rs:79-89 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:113-123 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:156-166 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 2) core/src/resources.rs:2674— core/src/resources.rs:2674-2680 | core/src/resources.rs:2683-2690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) dll/src/desktop/shell2/common/event.rs:2362— dll/src/desktop/shell2/common/event.rs:2362-2369 | dll/src/desktop/shell2/linux/x11/mod.rs:8253-8259 — 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–8 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:382— dll/src/desktop/shell2/linux/wayland/gl.rs:382-388 | dll/src/desktop/shell2/linux/x11/gl.rs:366-373 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 2) dll/src/desktop/extra/permission/linux.rs:151— dll/src/desktop/extra/permission/linux.rs:151-158 | dll/src/desktop/eyedropper/wayland.rs:102-108 — 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–8 lines × 2) doc/src/codegen/v2/lang_c.rs:920— doc/src/codegen/v2/lang_c.rs:920-926 | doc/src/codegen/v2/lang_c.rs:1007-1014 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:428— doc/src/codegen/v2/lang_php/wrappers.rs:428-435 | doc/src/codegen/v2/lang_php/wrappers.rs:546-552 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) layout/src/callbacks.rs:3683— layout/src/callbacks.rs:3683-3690 | layout/src/callbacks.rs:3788-3794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) layout/src/cpurender/raster.rs:83— layout/src/cpurender/raster.rs:83-90 | layout/src/cpurender/raster.rs:114-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) layout/src/scroll_timer.rs:519— layout/src/scroll_timer.rs:519-525 | layout/src/scroll_timer.rs:687-694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) layout/src/solver3/fc.rs:3587— layout/src/solver3/fc.rs:3587-3593 | layout/src/solver3/fc.rs:8683-8690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) layout/src/solver3/fc.rs:6482— layout/src/solver3/fc.rs:6482-6488 | layout/src/solver3/fc.rs:7959-7966 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
PlatformWindow::apply_user_change (cyclomatic 315) dll/src/desktop/shell2/common/event.rs:4824— PlatformWindow::apply_user_change has cyclomatic complexity 315 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlatformWindow::process_window_events_inner (cyclomatic 188) dll/src/desktop/shell2/common/event.rs:10294— PlatformWindow::process_window_events_inner has cyclomatic complexity 188 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlatformWindow::apply_system_change (cyclomatic 178) dll/src/desktop/shell2/common/event.rs:7142— PlatformWindow::apply_system_change has cyclomatic complexity 178 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PlatformWindow::dispatch_events_propagated (cyclomatic 75) dll/src/desktop/shell2/common/event.rs:8536— PlatformWindow::dispatch_events_propagated has cyclomatic complexity 75 (threshold 15). To reduce it, separate the cases: extract each independent 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: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::process_window_events (cyclomatic 31) dll/src/desktop/shell2/common/event.rs:9942— PlatformWindow::process_window_events 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::feed_seat_gesture_sessions (cyclomatic 17) dll/src/desktop/shell2/common/event.rs:9182— PlatformWindow::feed_seat_gesture_sessions has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::handle_scrollbar_drag (cyclomatic 17) dll/src/desktop/shell2/common/event.rs:13166— PlatformWindow::handle_scrollbar_drag has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::process_timers_and_threads (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12369— PlatformWindow::process_timers_and_threads 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::handle_track_click (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12688— PlatformWindow::handle_track_click 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::invoke_expired_timers (cyclomatic 16) dll/src/desktop/shell2/common/event.rs:12843— PlatformWindow::invoke_expired_timers 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: azul_dll::desktop::shell2::common::event::win32_vkey_to_virtual_key (cyclomatic 135) 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.
PlatformWindow::apply_user_change (cognitive 551) dll/src/desktop/shell2/common/event.rs:4824— PlatformWindow::apply_user_change has cognitive complexity 551 (threshold 15). Drivers by points: if/else 209 (496 pts), match/switch 10 (30 pts), loops 6 (18 pts), boolean chains 7 (nesting depth added 319). 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.
PlatformWindow::process_window_events_inner (cognitive 497) dll/src/desktop/shell2/common/event.rs:10294— PlatformWindow::process_window_events_inner has cognitive complexity 497 (threshold 15). Drivers by points: if/else 147 (394 pts), match/switch 13 (48 pts), loops 14 (42 pts), boolean chains 13 (nesting depth added 310). 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.
PlatformWindow::apply_system_change (cognitive 460) dll/src/desktop/shell2/common/event.rs:7142— PlatformWindow::apply_system_change has cognitive complexity 460 (threshold 15). Drivers by points: if/else 150 (428 pts), match/switch 9 (24 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 297). 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.
PlatformWindow::dispatch_events_propagated (cognitive 255) dll/src/desktop/shell2/common/event.rs:8536— PlatformWindow::dispatch_events_propagated has cognitive complexity 255 (threshold 15). Drivers by points: if/else 43 (167 pts), loops 17 (66 pts), match/switch 7 (18 pts), boolean chains 4 (nesting depth added 184). 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.
PlatformWindow::process_window_events (cognitive 54) dll/src/desktop/shell2/common/event.rs:9942— PlatformWindow::process_window_events has cognitive complexity 54 (threshold 15). Drivers by points: if/else 25 (42 pts), loops 4 (8 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlatformWindow::handle_track_click (cognitive 25) dll/src/desktop/shell2/common/event.rs:12688— PlatformWindow::handle_track_click has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (19 pts), match/switch 5 (6 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlatformWindow::invoke_expired_timers (cognitive 24) dll/src/desktop/shell2/common/event.rs:12843— PlatformWindow::invoke_expired_timers has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlatformWindow::handle_scrollbar_drag (cognitive 24) dll/src/desktop/shell2/common/event.rs:13166— PlatformWindow::handle_scrollbar_drag has cognitive complexity 24 (threshold 15). Drivers by points: if/else 19, match/switch 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PlatformWindow::process_timers_and_threads (cognitive 22) dll/src/desktop/shell2/common/event.rs:12369— PlatformWindow::process_timers_and_threads has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 6). 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.
PlatformWindow::feed_seat_gesture_sessions (cognitive 21) dll/src/desktop/shell2/common/event.rs:9182— PlatformWindow::feed_seat_gesture_sessions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, loops 3, match/switch 2 (3 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.
PythonGenerator::generate_pymethod (cognitive 139) doc/src/codegen/v2/lang_python.rs:2467— PythonGenerator::generate_pymethod has cognitive complexity 139 (threshold 15). Drivers by points: if/else 74 (114 pts), loops 6 (9 pts), match/switch 5 (9 pts), boolean chains 7 (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.
PythonGenerator::field_type_needs_unsendable (cognitive 67) doc/src/codegen/v2/lang_python.rs:3564— PythonGenerator::field_type_needs_unsendable has cognitive complexity 67 (threshold 15). Drivers by points: if/else 20 (43 pts), loops 5 (14 pts), boolean chains 7, match/switch 1 (3 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonGenerator::function_has_unsupported_args (cognitive 54) doc/src/codegen/v2/lang_python.rs:3771— PythonGenerator::function_has_unsupported_args has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (39 pts), boolean chains 11, match/switch 1 (3 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonGenerator::generate_callback_trampoline (cognitive 47) doc/src/codegen/v2/lang_python.rs:1075— PythonGenerator::generate_callback_trampoline has cognitive complexity 47 (threshold 15). Drivers by points: if/else 31 (37 pts), boolean chains 4, loops 3, match/switch 2 (3 pts) (nesting depth added 7). 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.
PythonGenerator::generate_enum_pymethods (cognitive 33) doc/src/codegen/v2/lang_python.rs:2316— PythonGenerator::generate_enum_pymethods has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonGenerator::is_python_compatible_type (cognitive 24) doc/src/codegen/v2/lang_python.rs:4009— PythonGenerator::is_python_compatible_type has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 6 (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.
PythonGenerator::generate_variant_accessors (cognitive 22) doc/src/codegen/v2/lang_python.rs:2246— PythonGenerator::generate_variant_accessors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonGenerator::function_refs_excluded_type (cognitive 20) doc/src/codegen/v2/lang_python.rs:3946— PythonGenerator::function_refs_excluded_type has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, 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.
PythonGenerator::enum_needs_unsendable (cognitive 19) doc/src/codegen/v2/lang_python.rs:3509— PythonGenerator::enum_needs_unsendable has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonGenerator::generate_derive_dunders (cognitive 16) doc/src/codegen/v2/lang_python.rs:1903— PythonGenerator::generate_derive_dunders has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 3, 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.
Duplicated block (24 lines × 2) core/src/compact.rs:655— core/src/compact.rs:655-678 | core/src/compact.rs:1520-1543 — both copies are in the same file, so extract the 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 (24 lines × 2) core/src/compact.rs:980— core/src/compact.rs:980-1003 | core/src/compact.rs:1022-1045 — both copies are in the same file, so extract the 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 (24 lines × 2) core/src/events.rs:1782— core/src/events.rs:1782-1805 | core/src/events.rs:2071-2094 — both copies are in the same file, so extract the 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 (24 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6208— dll/src/desktop/shell2/linux/x11/mod.rs:6208-6231 | dll/src/desktop/shell2/windows/mod.rs:1853-1876 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) doc/src/codegen/v2/lang_cpp/cpp17.rs:313— doc/src/codegen/v2/lang_cpp/cpp17.rs:313-336 | doc/src/codegen/v2/lang_cpp/cpp17.rs:362-385 — both copies are in the same file, so extract the 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 (24 lines × 2) doc/src/codegen/v2/lang_d/mod.rs:535— doc/src/codegen/v2/lang_d/mod.rs:535-558 | doc/src/codegen/v2/lang_swift/mod.rs:478-501 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) doc/src/codegen/v2/lang_rust.rs:2531— doc/src/codegen/v2/lang_rust.rs:2531-2554 | doc/src/codegen/v2/lang_rust.rs:2606-2629 — both copies are in the same file, so extract the 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 (24 lines × 2) layout/src/desktop/dialogs.rs:542— layout/src/desktop/dialogs.rs:542-565 | layout/src/desktop/dialogs.rs:623-646 — both copies are in the same file, so extract the 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 (24 lines × 2) layout/src/text3/cache.rs:5930— layout/src/text3/cache.rs:5930-5953 | layout/src/text3/cache.rs:5965-5988 — both copies are in the same file, so extract the 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 (24 lines × 2) webrender/core/src/quad.rs:516— webrender/core/src/quad.rs:516-539 | webrender/core/src/quad.rs:681-704 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) core/src/xml.rs:8376— core/src/xml.rs:8376-8398 | core/src/xml.rs:8667-8689 — both copies are in the same file, so extract the 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 (23 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3034— dll/src/desktop/shell2/linux/wayland/mod.rs:3034-3056 | dll/src/desktop/shell2/linux/x11/mod.rs:4552-4574 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 2) dll/src/desktop/shell2/windows/mod.rs:4981— dll/src/desktop/shell2/windows/mod.rs:4981-5003 | dll/src/desktop/shell2/windows/mod.rs:5073-5095 — both copies are in the same file, so extract the 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 (23 lines × 2) doc/src/api.rs:2064— doc/src/api.rs:2064-2086 | doc/src/api.rs:2342-2364 — both copies are in the same file, so extract the 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 (23 lines × 2) doc/src/patch/index.rs:1250— doc/src/patch/index.rs:1250-1272 | doc/src/patch/index.rs:1331-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 (23 lines × 2) layout/src/solver3/cache.rs:1939— layout/src/solver3/cache.rs:1939-1961 | layout/src/solver3/cache.rs:2102-2124 — both copies are in the same file, so extract the 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 (23 lines × 2) layout/src/widgets/themes/flat.rs:932— layout/src/widgets/themes/flat.rs:932-954 | layout/src/widgets/themes/flora.rs:1204-1226 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) webrender/core/src/batch.rs:1843— webrender/core/src/batch.rs:1843-1865 | webrender/core/src/batch.rs:1898-1920 — both copies are in the same file, so extract the 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 (23 lines × 2) webrender/core/src/picture.rs:4316— webrender/core/src/picture.rs:4316-4338 | webrender/core/src/picture.rs:4451-4473 — both copies are in the same file, so extract the 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 (23 lines × 2) webrender/core/src/render_task.rs:1366— webrender/core/src/render_task.rs:1366-1388 | webrender/core/src/render_task.rs:1555-1577 — both copies are in the same file, so extract the 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) dll/src/desktop/shell2/linux/wayland/mod.rs:4654— dll/src/desktop/shell2/linux/wayland/mod.rs:4654-4666 | dll/src/desktop/shell2/linux/wayland/mod.rs:5863-5876 — both copies are in the same file, so extract the 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) doc/src/autofix/diff.rs:615— doc/src/autofix/diff.rs:615-627 | doc/src/autofix/diff.rs:2235-2248 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_crystal/mod.rs:337— doc/src/codegen/v2/lang_crystal/mod.rs:337-350 | doc/src/codegen/v2/lang_julia/mod.rs:229-241 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–14 lines × 2) doc/src/codegen/v2/lang_d/mod.rs:380— doc/src/codegen/v2/lang_d/mod.rs:380-393 | doc/src/codegen/v2/lang_swift/mod.rs:356-368 — `doc/src/codegen/v2/lang_d/mod.rs` and `doc/src/codegen/v2/lang_swift/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–14 lines × 2) layout/src/cpurender/svg.rs:72— layout/src/cpurender/svg.rs:72-85 | layout/src/cpurender/svg.rs:134-146 — both copies are in the same file, so extract the 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) layout/src/solver3/cache.rs:2861— layout/src/solver3/cache.rs:2861-2873 | layout/src/solver3/cache.rs:3540-3553 — both copies are in the same file, so extract the 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) layout/src/solver3/fc.rs:1762— layout/src/solver3/fc.rs:1762-1774 | layout/src/solver3/fc.rs:1912-1925 — both copies are in the same file, so extract the 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) layout/src/solver3/getters.rs:3273— layout/src/solver3/getters.rs:3273-3286 | layout/src/solver3/getters.rs:4285-4297 — both copies are in the same file, so extract the 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) layout/src/solver3/layout_tree.rs:504— layout/src/solver3/layout_tree.rs:504-516 | layout/src/text3/dense.rs:1202-1215 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) layout/src/widgets/camera.rs:347— layout/src/widgets/camera.rs:347-360 | layout/src/widgets/screencap.rs:312-324 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) css/src/dynamic_selector.rs:2327— css/src/dynamic_selector.rs:2327-2337 | css/src/parser2.rs:1335-1346 — 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–12 lines × 2) dll/src/desktop/extra/geolocation/ios.rs:113— dll/src/desktop/extra/geolocation/ios.rs:113-124 | dll/src/desktop/extra/geolocation/macos.rs:107-117 — before extracting anything, compare `dll/src/desktop/extra/geolocation/ios.rs` and `dll/src/desktop/extra/geolocation/macos.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 130 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 2) dll/src/web/symbol_table.rs:1594— dll/src/web/symbol_table.rs:1594-1604 | dll/src/web/symbol_table.rs:1620-1631 — both copies are in the same file, so extract the 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–12 lines × 2) doc/src/autofix/diff.rs:650— doc/src/autofix/diff.rs:650-661 | doc/src/autofix/diff.rs:2269-2279 — both copies are in the same file, so extract the 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–12 lines × 2) doc/src/autofix/discovery/parallel.rs:132— doc/src/autofix/discovery/parallel.rs:132-142 | doc/src/autofix/discovery/workspace.rs:147-158 — 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–12 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:2076— doc/src/codegen/v2/lang_d/wrappers.rs:2076-2086 | doc/src/codegen/v2/lang_swift/wrappers.rs:2033-2044 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11–12 lines × 2) doc/src/reftest/pipeline.rs:100— doc/src/reftest/pipeline.rs:100-111 | doc/src/reftest/pipeline.rs:457-467 — both copies are in the same file, so extract the 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–12 lines × 2) doc/src/codegen/v2/lang_ruby/types.rs:257— doc/src/codegen/v2/lang_ruby/types.rs:257-267 | doc/src/codegen/v2/lang_ruby/types.rs:494-505 — both copies are in the same file, so extract the 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–12 lines × 2) layout/src/cpurender/svg.rs:521— layout/src/cpurender/svg.rs:521-531 | layout/src/xml/svg.rs:2043-2054 — `layout/src/cpurender/svg.rs` and `layout/src/xml/svg.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11–12 lines × 2) layout/src/text3/edit.rs:771— layout/src/text3/edit.rs:771-782 | layout/src/text3/edit.rs:911-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) doc/src/autofix/type_index.rs:254— doc/src/autofix/type_index.rs:254-263 | doc/src/autofix/type_index.rs:421-430 | doc/src/autofix/type_index.rs:494-503 | doc/src/autofix/type_index.rs:530-539 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:251— doc/src/codegen/v2/lang_cpp/cpp03.rs:251-260 | doc/src/codegen/v2/lang_cpp/cpp11.rs:160-169 | doc/src/codegen/v2/lang_cpp/cpp17.rs:291-300 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1004-1013 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_rust.rs:3793— doc/src/codegen/v2/lang_rust.rs:3793-3802 | doc/src/codegen/v2/lang_rust.rs:3881-3890 | doc/src/codegen/v2/rust/dynamic_binding.rs:170-179 | doc/src/codegen/v2/rust/dynamic_binding.rs:298-307 — 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.
Duplicated block (10 lines × 4) doc/src/reftest/autodebug.rs:2198— doc/src/reftest/autodebug.rs:2198-2209 | doc/src/reftest/autodoc.rs:934-943 | doc/src/reftest/autoreview.rs:1144-1154 | doc/src/reftest/autoreview.rs:1583-1593 — before extracting anything, compare `doc/src/reftest/autodebug.rs` and `doc/src/reftest/autodoc.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) layout/src/font.rs:2505— layout/src/font.rs:2505-2514 | layout/src/font.rs:2517-2526 | layout/src/text3/default.rs:382-391 | layout/src/text3/default.rs:395-404 — 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.
Duplicated block (10 lines × 4) layout/src/widgets/ribbon.rs:1016— layout/src/widgets/ribbon.rs:1016-1025 | layout/src/widgets/ribbon.rs:1134-1143 | layout/src/widgets/ribbon.rs:1299-1308 | layout/src/widgets/ribbon.rs:1348-1357 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) layout/src/window.rs:2820— layout/src/window.rs:2820-2829 | layout/src/window.rs:3610-3619 | layout/src/window.rs:3933-3942 | layout/src/window.rs:4122-4131 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_go/mod.rs:97— doc/src/codegen/v2/lang_go/mod.rs:97-106 | doc/src/codegen/v2/lang_haskell/mod.rs:370-379 | doc/src/codegen/v2/lang_node/mod.rs:409-418 | doc/src/codegen/v2/lang_vb6/mod.rs:167-176 — `doc/src/codegen/v2/lang_go/mod.rs` and `doc/src/codegen/v2/lang_vb6/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:134— doc/src/codegen/v2/lang_cpp/cpp03.rs:134-144 | doc/src/codegen/v2/lang_cpp/cpp11.rs:652-661 | doc/src/codegen/v2/lang_cpp/cpp17.rs:148-158 | doc/src/codegen/v2/lang_cpp/cpp20.rs:625-634 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) doc/src/autofix/type_index.rs:259— doc/src/autofix/type_index.rs:259-268 | doc/src/autofix/type_index.rs:310-319 | doc/src/autofix/type_index.rs:499-508 | doc/src/autofix/type_index.rs:535-544 — 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.
X11Window::handle_event (cyclomatic 72) dll/src/desktop/shell2/linux/x11/mod.rs:4836— X11Window::handle_event has cyclomatic complexity 72 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
X11Window::render_and_present (cyclomatic 60) dll/src/desktop/shell2/linux/x11/mod.rs:6380— X11Window::render_and_present 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.
X11Window::new_with_resources (cyclomatic 44) dll/src/desktop/shell2/linux/x11/mod.rs:3227— X11Window::new_with_resources has cyclomatic complexity 44 (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.
X11Window::handle_mouse_button (cyclomatic 43) dll/src/desktop/shell2/linux/x11/events.rs:476— X11Window::handle_mouse_button 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::linux::x11::events::keysym_to_virtual_keycode (cyclomatic 131) 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.
X11Window::wait_for_events (cyclomatic 30) dll/src/desktop/shell2/linux/x11/mod.rs:4486— X11Window::wait_for_events 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. This is NOT this file's highest cyclomatic complexity: X11Window::set_cursor (cyclomatic 34) 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.
X11Window::sync_window_state (cyclomatic 24) dll/src/desktop/shell2/linux/x11/mod.rs:7443— X11Window::sync_window_state 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: X11Window::set_cursor (cyclomatic 34) 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.
X11Window::handle_keyboard (cyclomatic 20) dll/src/desktop/shell2/linux/x11/events.rs:1002— X11Window::handle_keyboard 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: azul_dll::desktop::shell2::linux::x11::events::keysym_to_virtual_keycode (cyclomatic 131) 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.
X11Window::set_prevent_system_sleep (cyclomatic 18) dll/src/desktop/shell2/linux/x11/mod.rs:8606— X11Window::set_prevent_system_sleep 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: X11Window::set_cursor (cyclomatic 34) 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.
X11Window::process_pending_menu_callbacks (cyclomatic 16) dll/src/desktop/shell2/linux/x11/mod.rs:4340— X11Window::process_pending_menu_callbacks 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: X11Window::set_cursor (cyclomatic 34) 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.
DisplayListGenerator::paint_inline_content (cyclomatic 50) layout/src/solver3/display_list.rs:7603— DisplayListGenerator::paint_inline_content 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.
DisplayListGenerator::generate_for_stacking_context (cyclomatic 32) layout/src/solver3/display_list.rs:4690— DisplayListGenerator::generate_for_stacking_context 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_in_flow_descendants (cyclomatic 27) layout/src/solver3/display_list.rs:4993— DisplayListGenerator::paint_in_flow_descendants 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_cursor (cyclomatic 26) layout/src/solver3/display_list.rs:4375— DisplayListGenerator::paint_cursor 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::maybe_paint_placeholder_prompt (cyclomatic 26) layout/src/solver3/display_list.rs:6892— DisplayListGenerator::maybe_paint_placeholder_prompt 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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_collapsed_table_borders (cyclomatic 25) layout/src/solver3/display_list.rs:6372— DisplayListGenerator::paint_collapsed_table_borders has cyclomatic complexity 25 (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. This is NOT this file's highest cyclomatic complexity: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_node_background_and_border_inner (cyclomatic 24) layout/src/solver3/display_list.rs:5889— DisplayListGenerator::paint_node_background_and_border_inner 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: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_node_content_inner (cyclomatic 24) layout/src/solver3/display_list.rs:6665— DisplayListGenerator::paint_node_content_inner 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: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
DisplayListGenerator::paint_scrollbars (cyclomatic 21) layout/src/solver3/display_list.rs:7128— DisplayListGenerator::paint_scrollbars 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: azul_layout::solver3::display_list::offset_display_item_y (cyclomatic 41) 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.
Duplicated block (15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5043— dll/src/desktop/shell2/linux/wayland/mod.rs:5043-5057 | dll/src/desktop/shell2/linux/x11/events.rs:981-995 | dll/src/desktop/shell2/macos/events.rs:684-698 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:4225— dll/src/desktop/shell2/linux/x11/mod.rs:4225-4239 | dll/src/desktop/shell2/macos/mod.rs:9190-9204 | dll/src/desktop/shell2/windows/mod.rs:7644-7658 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:293— doc/src/codegen/v2/lang_cpp/cpp03.rs:293-307 | doc/src/codegen/v2/lang_cpp/cpp11.rs:192-206 | doc/src/codegen/v2/lang_cpp/cpp17.rs:340-354 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_crystal/mod.rs:548— doc/src/codegen/v2/lang_crystal/mod.rs:548-562 | doc/src/codegen/v2/lang_d/mod.rs:730-744 | doc/src/codegen/v2/lang_swift/mod.rs:596-610 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_d/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:615— doc/src/codegen/v2/lang_node/wrappers.rs:615-629 | doc/src/codegen/v2/lang_node/wrappers.rs:772-786 | doc/src/codegen/v2/lang_node/wrappers.rs:1253-1267 — 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 (15 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:169— doc/src/codegen/v2/lang_ada/types.rs:169-183 | doc/src/codegen/v2/lang_cobol/types.rs:180-194 | doc/src/codegen/v2/lang_pascal/types.rs:114-128 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 3) layout/src/solver3/fc.rs:5938— layout/src/solver3/fc.rs:5938-5952 | layout/src/solver3/fc.rs:5968-5982 | layout/src/solver3/fc.rs:5998-6012 — 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 (15 lines × 3) layout/src/widgets/themes/flora.rs:924— layout/src/widgets/themes/flora.rs:924-938 | layout/src/widgets/themes/flora.rs:1090-1104 | layout/src/widgets/themes/flora.rs:1915-1929 — 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 (15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3717— dll/src/desktop/shell2/linux/wayland/mod.rs:3717-3731 | dll/src/desktop/shell2/linux/wayland/mod.rs:9853-9867 | dll/src/desktop/shell2/windows/mod.rs:2014-2029 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3384— dll/src/desktop/shell2/linux/wayland/mod.rs:3384-3396 | dll/src/desktop/shell2/linux/x11/mod.rs:4386-4398 | dll/src/desktop/shell2/windows/mod.rs:6289-6301 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:153— doc/src/codegen/v2/lang_cpp/cpp11.rs:153-165 | doc/src/codegen/v2/lang_cpp/cpp17.rs:284-296 | doc/src/codegen/v2/lang_cpp/cpp20.rs:997-1009 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) doc/src/codegen/v2/lang_haskell/functions.rs:300— doc/src/codegen/v2/lang_haskell/functions.rs:300-312 | doc/src/codegen/v2/lang_haskell/functions.rs:650-662 | doc/src/codegen/v2/lang_haskell/functions.rs:741-753 — 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 (13 lines × 3) doc/src/codegen/v2/lang_perl/types.rs:741— doc/src/codegen/v2/lang_perl/types.rs:741-753 | doc/src/codegen/v2/lang_red/mod.rs:747-759 | doc/src/codegen/v2/managed_host_invoker.rs:562-574 — 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 (13 lines × 3) layout/src/solver3/display_list.rs:2078— layout/src/solver3/display_list.rs:2078-2090 | layout/src/solver3/display_list.rs:2097-2109 | layout/src/solver3/display_list.rs:2116-2128 — 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 (13 lines × 3) layout/src/window.rs:8368— layout/src/window.rs:8368-8380 | layout/src/window.rs:8397-8409 | layout/src/window.rs:8429-8441 — 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 (13 lines × 3) webrender/core/src/render_task.rs:1782— webrender/core/src/render_task.rs:1782-1794 | webrender/core/src/render_task.rs:1807-1819 | webrender/core/src/render_task.rs:1832-1844 — 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 (13 lines × 3) webrender/core/src/renderer/mod.rs:4125— webrender/core/src/renderer/mod.rs:4125-4137 | webrender/core/src/renderer/mod.rs:4152-4164 | webrender/core/src/renderer/mod.rs:4179-4191 — 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 (13 lines × 3) dll/src/desktop/shell2/android/mod.rs:982— dll/src/desktop/shell2/android/mod.rs:982-994 | dll/src/desktop/shell2/android/mod.rs:1746-1758 | dll/src/desktop/shell2/android/mod.rs:1942-1954 — 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.
CssPropertyCache::restyle (cognitive 279) core/src/prop_cache.rs:1570— CssPropertyCache::restyle has cognitive complexity 279 (threshold 15). Drivers by points: if/else 49 (159 pts), loops 26 (100 pts), match/switch 3 (12 pts), boolean chains 8 (nesting depth added 193). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPropertyCache::build_compact_cache_with_inheritance_debug (cognitive 240) core/src/compact.rs:503— CssPropertyCache::build_compact_cache_with_inheritance_debug has cognitive complexity 240 (threshold 15). Drivers by points: if/else 73 (216 pts), loops 8 (16 pts), match/switch 2 (6 pts), boolean chains 2 (nesting depth added 155). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPropertyCache::build_compact_cache (cognitive 125) core/src/compact.rs:57— CssPropertyCache::build_compact_cache has cognitive complexity 125 (threshold 15). Drivers by points: if/else 61 (117 pts), match/switch 1 (4 pts), boolean chains 2, loops 2 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPropertyCache::get_computed_css_style_string (cognitive 84) core/src/prop_cache.rs:2149— CssPropertyCache::get_computed_css_style_string has cognitive complexity 84 (threshold 15). Drivers by points: if/else 84. 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.
CssPropertyCache::get_property_slow (cognitive 80) core/src/prop_cache.rs:2783— CssPropertyCache::get_property_slow has cognitive complexity 80 (threshold 15). Drivers by points: if/else 54 (70 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 17). 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.
CssPropertyCache::generate_tag_ids (cognitive 29) core/src/prop_cache.rs:1960— CssPropertyCache::generate_tag_ids has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CssPropertyCache::prune_compact_normal_props (cognitive 26) core/src/prop_cache.rs:1215— CssPropertyCache::prune_compact_normal_props has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (10 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.
CssPropertyCache::normal_props_present (cognitive 20) core/src/prop_cache.rs:5013— CssPropertyCache::normal_props_present has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (13 pts), if/else 3 (7 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SceneBuilder::wrap_prim_with_filters (cognitive 113) webrender/core/src/scene_building.rs:3599— SceneBuilder::wrap_prim_with_filters has cognitive complexity 113 (threshold 15). Drivers by points: if/else 25 (71 pts), loops 10 (27 pts), match/switch 4 (14 pts), boolean chains 1 (nesting depth added 73). Of this number, 106 points are the body's own statements and 7 belong to one function item 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.
SceneBuilder::add_box_shadow (cognitive 35) webrender/core/src/box_shadow.rs:291— SceneBuilder::add_box_shadow has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 3 (6 pts), boolean chains 3 (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.
SceneBuilder::finalize_picture (cognitive 30) webrender/core/src/scene_building.rs:670— SceneBuilder::finalize_picture has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (7 pts), match/switch 3 (5 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.
SceneBuilder::build_all (cognitive 28) webrender/core/src/scene_building.rs:856— SceneBuilder::build_all has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SceneBuilder::push_stacking_context (cognitive 27) webrender/core/src/scene_building.rs:1972— SceneBuilder::push_stacking_context has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 5 (7 pts), boolean chains 3 (nesting depth added 6). 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.
SceneBuilder::build_item (cognitive 23) webrender/core/src/scene_building.rs:1332— SceneBuilder::build_item has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). 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.
SceneBuilder::pop_stacking_context (cognitive 23) webrender/core/src/scene_building.rs:2192— SceneBuilder::pop_stacking_context has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (5 pts), match/switch 2, 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.
SceneBuilder::pop_all_shadows (cognitive 18) webrender/core/src/scene_building.rs:2721— SceneBuilder::pop_all_shadows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (6 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (22 lines × 2) dll/src/desktop/shell2/common/event.rs:8894— dll/src/desktop/shell2/common/event.rs:8894-8915 | dll/src/desktop/shell2/common/event.rs:8924-8945 — both copies are in the same file, so extract the 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 (22 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3087— dll/src/desktop/shell2/linux/wayland/mod.rs:3087-3108 | dll/src/desktop/shell2/linux/x11/mod.rs:4600-4621 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (22 lines × 2) dll/src/desktop/shell2/macos/mod.rs:5707— dll/src/desktop/shell2/macos/mod.rs:5707-5728 | dll/src/desktop/shell2/windows/mod.rs:793-814 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (22 lines × 2) layout/src/widgets/check_box.rs:356— layout/src/widgets/check_box.rs:356-377 | layout/src/widgets/switch.rs:406-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.
Duplicated block (22 lines × 2) layout/src/xml/mod.rs:622— layout/src/xml/mod.rs:622-643 | layout/src/xml/mod.rs:734-755 — both copies are in the same file, so extract the 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 (22 lines × 2) layout/src/widgets/themes/flat.rs:1784— layout/src/widgets/themes/flat.rs:1784-1805 | layout/src/widgets/themes/flora.rs:2202-2223 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) webrender/core/src/picture.rs:4683— webrender/core/src/picture.rs:4683-4704 | webrender/core/src/render_task.rs:2174-2195 — 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 (22 lines × 2) dll/src/desktop/extra/audio/alsa.rs:82— dll/src/desktop/extra/audio/alsa.rs:82-104 | dll/src/desktop/extra/audio/alsa.rs:176-197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) dll/src/desktop/display.rs:834— dll/src/desktop/display.rs:834-848 | dll/src/desktop/display.rs:1030-1043 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) dll/src/desktop/shell2/windows/mod.rs:1460— dll/src/desktop/shell2/windows/mod.rs:1460-1474 | dll/src/desktop/shell2/windows/mod.rs:7927-7940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) doc/src/autofix/type_index.rs:1656— doc/src/autofix/type_index.rs:1656-1670 | doc/src/autofix/type_index.rs:1721-1734 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:2914— doc/src/codegen/v2/lang_rust.rs:2914-2927 | doc/src/codegen/v2/lang_rust.rs:3247-3261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:3536— doc/src/codegen/v2/lang_rust.rs:3536-3549 | doc/src/codegen/v2/lang_rust.rs:3741-3755 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) doc/src/reftest/apply_midlevel.rs:560— doc/src/reftest/apply_midlevel.rs:560-574 | doc/src/reftest/apply_midlevel.rs:613-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) layout/src/solver3/fc.rs:7551— layout/src/solver3/fc.rs:7551-7565 | layout/src/solver3/fc.rs:7590-7603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) webrender/core/src/render_target.rs:986— webrender/core/src/render_target.rs:986-999 | webrender/core/src/render_target.rs:1306-1320 — both copies are in the same file, so extract the 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 × 3) dll/src/desktop/shell2/common/event.rs:686— dll/src/desktop/shell2/common/event.rs:686-697 | dll/src/desktop/shell2/common/event.rs:942-953 | dll/src/desktop/shell2/common/event.rs:996-1007 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) layout/src/callbacks.rs:1935— layout/src/callbacks.rs:1935-1946 | layout/src/callbacks.rs:7264-7275 | layout/src/timer.rs:371-382 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (12 lines × 3) layout/src/window.rs:2053— layout/src/window.rs:2053-2064 | layout/src/window.rs:4688-4699 | layout/src/window.rs:7782-7793 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) layout/src/window.rs:13952— layout/src/window.rs:13952-13963 | layout/src/window.rs:14304-14315 | layout/src/window.rs:14706-14717 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:216— doc/src/codegen/v2/lang_ada/types.rs:216-227 | doc/src/codegen/v2/lang_ocaml/types.rs:342-353 | doc/src/codegen/v2/lang_smalltalk/types.rs:99-110 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_smalltalk/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) doc/src/autofix/workspace.rs:1070— doc/src/autofix/workspace.rs:1070-1081 | doc/src/autofix/workspace.rs:1091-1103 | doc/src/autofix/workspace.rs:1271-1284 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) doc/src/codegen/v2/lang_rust.rs:3155— doc/src/codegen/v2/lang_rust.rs:3155-3166 | doc/src/codegen/v2/lang_rust.rs:3225-3237 | doc/src/codegen/v2/lang_rust.rs:3278-3289 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) doc/src/dllgen/deploy.rs:107— doc/src/dllgen/deploy.rs:107-118 | doc/src/dllgen/deploy.rs:125-136 | doc/src/dllgen/deploy.rs:143-154 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
SceneBuilder::wrap_prim_with_filters (cyclomatic 49) webrender/core/src/scene_building.rs:3599— SceneBuilder::wrap_prim_with_filters has cyclomatic complexity 49 (threshold 15). Of this number, 45 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SceneBuilder::build_item (cyclomatic 34) webrender/core/src/scene_building.rs:1332— SceneBuilder::build_item has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
SceneBuilder::push_stacking_context (cyclomatic 21) webrender/core/src/scene_building.rs:1972— SceneBuilder::push_stacking_context has cyclomatic complexity 21 (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.
SceneBuilder::finalize_picture (cyclomatic 20) webrender/core/src/scene_building.rs:670— SceneBuilder::finalize_picture 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.
SceneBuilder::build_all (cyclomatic 17) webrender/core/src/scene_building.rs:856— SceneBuilder::build_all 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.
SceneBuilder::add_box_shadow (cyclomatic 16) webrender/core/src/box_shadow.rs:291— SceneBuilder::add_box_shadow 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.
SceneBuilder::pop_stacking_context (cyclomatic 16) webrender/core/src/scene_building.rs:2192— SceneBuilder::pop_stacking_context 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.
Renderer::render_impl (cyclomatic 34) webrender/core/src/renderer/mod.rs:1417— Renderer::render_impl 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.
Renderer::update (cyclomatic 26) webrender/core/src/renderer/mod.rs:984— Renderer::update 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.
Renderer::draw_alpha_batch_container (cyclomatic 25) webrender/core/src/renderer/mod.rs:2837— Renderer::draw_alpha_batch_container 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.
Renderer::draw_frame (cyclomatic 25) webrender/core/src/renderer/mod.rs:4534— Renderer::draw_frame 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.
Renderer::update_texture_cache (cyclomatic 21) webrender/core/src/renderer/mod.rs:1796— Renderer::update_texture_cache 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.
Renderer::draw_color_target (cyclomatic 21) webrender/core/src/renderer/mod.rs:3568— Renderer::draw_color_target has cyclomatic complexity 21 (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.
Renderer::draw_texture_cache_target (cyclomatic 18) webrender/core/src/renderer/mod.rs:3949— Renderer::draw_texture_cache_target 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.
Win32Window::render_and_present (cognitive 242) dll/src/desktop/shell2/windows/mod.rs:1139— Win32Window::render_and_present has cognitive complexity 242 (threshold 15). Drivers by points: if/else 58 (187 pts), loops 4 (32 pts), match/switch 3 (12 pts), boolean chains 11 (nesting depth added 166). 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.
Win32Window::sync_window_state (cognitive 50) dll/src/desktop/shell2/windows/mod.rs:2724— Win32Window::sync_window_state has cognitive complexity 50 (threshold 15). Drivers by points: if/else 28 (41 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Win32Window::new (cognitive 47) dll/src/desktop/shell2/windows/mod.rs:300— Win32Window::new has cognitive complexity 47 (threshold 15). Drivers by points: if/else 29 (41 pts), loops 2 (3 pts), match/switch 1 (2 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.
Win32Window::feed_pointer (cognitive 37) dll/src/desktop/shell2/windows/mod.rs:3591— Win32Window::feed_pointer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 3 (5 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.
Win32Window::try_show_context_menu (cognitive 27) dll/src/desktop/shell2/windows/mod.rs:3359— Win32Window::try_show_context_menu has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 2 (3 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.
Win32Window::regenerate_layout_inner (cognitive 17) dll/src/desktop/shell2/windows/mod.rs:1815— Win32Window::regenerate_layout_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 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.
Win32Window::route_main_window_result (cognitive 16) dll/src/desktop/shell2/windows/mod.rs:2008— Win32Window::route_main_window_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 1 (3 pts), match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RemillTranspiler::lift_with_transitive_deps_sequential (cognitive 242) dll/src/web/transpiler_remill.rs:2167— RemillTranspiler::lift_with_transitive_deps_sequential has cognitive complexity 242 (threshold 15). Drivers by points: if/else 57 (171 pts), loops 20 (39 pts), match/switch 10 (25 pts), boolean chains 7 (nesting depth added 148). 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.
RemillTranspiler::produce_object_from_lifted_ir (cognitive 153) dll/src/web/transpiler_remill.rs:1272— RemillTranspiler::produce_object_from_lifted_ir has cognitive complexity 153 (threshold 15). Drivers by points: if/else 46 (126 pts), boolean chains 25, loops 1, match/switch 1 (nesting depth added 80). 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.
RemillTranspiler::lift_with_transitive_deps_batched (cognitive 115) dll/src/web/transpiler_remill.rs:3387— RemillTranspiler::lift_with_transitive_deps_batched has cognitive complexity 115 (threshold 15). Drivers by points: if/else 35 (75 pts), loops 18 (32 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemillTranspiler::lift_fn (cognitive 52) dll/src/web/transpiler_remill.rs:1013— RemillTranspiler::lift_fn has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (44 pts), loops 1 (6 pts), boolean chains 2 (nesting depth added 29). 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.
RemillTranspiler::emit_indirect_dispatcher_obj (cognitive 30) dll/src/web/transpiler_remill.rs:3039— RemillTranspiler::emit_indirect_dispatcher_obj has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 7 (8 pts), match/switch 2 (4 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.
RemillTranspiler::link_objects_to_wasm (cognitive 18) dll/src/web/transpiler_remill.rs:1924— RemillTranspiler::link_objects_to_wasm has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 4 (6 pts), match/switch 1 (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.
RemillTranspiler::dispatcher_csynths (cognitive 18) dll/src/web/transpiler_remill.rs:3306— RemillTranspiler::dispatcher_csynths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 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.
TileCacheInstance::update_prim_dependencies (cognitive 161) webrender/core/src/picture.rs:3038— TileCacheInstance::update_prim_dependencies has cognitive complexity 161 (threshold 15). Drivers by points: if/else 48 (112 pts), loops 12 (29 pts), boolean chains 10, match/switch 5 (10 pts) (nesting depth added 86). 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.
TileCacheInstance::pre_update (cognitive 106) webrender/core/src/picture.rs:2047— TileCacheInstance::pre_update has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (61 pts), loops 15 (31 pts), boolean chains 7, match/switch 4 (7 pts) (nesting depth added 57). 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.
TileCacheInstance::post_update (cognitive 50) webrender/core/src/picture.rs:3850— TileCacheInstance::post_update has cognitive complexity 50 (threshold 15). Drivers by points: loops 15 (32 pts), if/else 8 (18 pts) (nesting depth added 27). 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.
TileCacheInstance::setup_compositor_surfaces_impl (cognitive 35) webrender/core/src/picture.rs:2710— TileCacheInstance::setup_compositor_surfaces_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 6 (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.
TileCacheInstance::prepare_for_new_scene (cognitive 29) webrender/core/src/picture.rs:1942— TileCacheInstance::prepare_for_new_scene has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (10 pts) (nesting depth added 20). 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.
TileCacheInstance::can_promote_to_surface (cognitive 21) webrender/core/src/picture.rs:2508— TileCacheInstance::can_promote_to_surface has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, 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.
TileCacheInstance::push_surface (cognitive 20) webrender/core/src/picture.rs:2968— TileCacheInstance::push_surface has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (7 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.
MacOSWindow::render_and_present_in_draw_rect (cognitive 128) dll/src/desktop/shell2/macos/mod.rs:7700— MacOSWindow::render_and_present_in_draw_rect has cognitive complexity 128 (threshold 15). Drivers by points: if/else 46 (94 pts), match/switch 8 (28 pts), boolean chains 6 (nesting depth added 68). 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.
MacOSWindow::sync_window_state (cognitive 67) dll/src/desktop/shell2/macos/mod.rs:6307— MacOSWindow::sync_window_state has cognitive complexity 67 (threshold 15). Drivers by points: if/else 31 (55 pts), match/switch 5 (10 pts), boolean chains 2 (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.
MacOSWindow::new_with_options_internal (cognitive 51) dll/src/desktop/shell2/macos/mod.rs:4965— MacOSWindow::new_with_options_internal has cognitive complexity 51 (threshold 15). Drivers by points: if/else 31 (35 pts), match/switch 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). 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.
MacOSWindow::apply_background_material (cognitive 38) dll/src/desktop/shell2/macos/mod.rs:6875— MacOSWindow::apply_background_material has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (33 pts), match/switch 3 (5 pts) (nesting depth added 22). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MacOSWindow::handle_scroll_wheel (cognitive 36) dll/src/desktop/shell2/macos/events.rs:459— MacOSWindow::handle_scroll_wheel has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, match/switch 1 (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.
MacOSWindow::initialize_display_link (cognitive 21) dll/src/desktop/shell2/macos/mod.rs:4724— MacOSWindow::initialize_display_link has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, match/switch 1 (nesting depth added 4). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (mark_views_dirty_on_main, display_link_callback). 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.
MacOSWindow::update_keyboard_state (cognitive 16) dll/src/desktop/shell2/macos/events.rs:1205— MacOSWindow::update_keyboard_state has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (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.
SwCompositor::occlude_surfaces (cognitive 48) webrender/core/src/compositor/sw_compositor.rs:840— SwCompositor::occlude_surfaces has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (35 pts), boolean chains 7, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 26). Of this number, 41 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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.
SwCompositor::flush_composites (cognitive 43) webrender/core/src/compositor/sw_compositor.rs:1130— SwCompositor::flush_composites has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (30 pts), loops 3 (8 pts), match/switch 4 (5 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.
SwCompositor::start_compositing (cognitive 40) webrender/core/src/compositor/sw_compositor.rs:1538— SwCompositor::start_compositing has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (18 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SwCompositor::queue_composite (cognitive 32) webrender/core/src/compositor/sw_compositor.rs:1017— SwCompositor::queue_composite has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 4 (21 pts), if/else 6 (11 pts) (nesting depth added 22). 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.
SwCompositor::init_overlaps (cognitive 23) webrender/core/src/compositor/sw_compositor.rs:958— SwCompositor::init_overlaps has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), match/switch 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.
SwCompositor::bind (cognitive 19) webrender/core/src/compositor/sw_compositor.rs:1391— SwCompositor::bind has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1 (nesting depth added 11). 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.
SwCompositor::end_frame (cognitive 16) webrender/core/src/compositor/sw_compositor.rs:1618— SwCompositor::end_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (8 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.
Duplicated block (19–20 lines × 2) css/src/parser2.rs:903— css/src/parser2.rs:903-921 | css/src/parser2.rs:1890-1909 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:7390— dll/src/desktop/shell2/linux/x11/mod.rs:7390-7408 | dll/src/desktop/shell2/linux/x11/mod.rs:8448-8467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) dll/src/desktop/extra/biometric/mod.rs:61— dll/src/desktop/extra/biometric/mod.rs:61-80 | dll/src/desktop/extra/keyring/mod.rs:50-68 — 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 (19–20 lines × 2) doc/src/api.rs:2197— doc/src/api.rs:2197-2216 | doc/src/api.rs:2464-2482 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) doc/src/autofix/type_index.rs:220— doc/src/autofix/type_index.rs:220-239 | doc/src/autofix/type_index.rs:337-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) layout/src/solver3/fc.rs:10933— layout/src/solver3/fc.rs:10933-10951 | layout/src/solver3/fc.rs:11016-11035 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–20 lines × 2) layout/src/text3/dense.rs:1334— layout/src/text3/dense.rs:1334-1353 | layout/src/text3/dense.rs:1501-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.
Duplicated block (12–14 lines × 2) dll/src/desktop/compositor2.rs:2273— dll/src/desktop/compositor2.rs:2273-2284 | dll/src/desktop/compositor2.rs:2326-2339 — both copies are in the same file, so extract the 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–14 lines × 2) doc/src/autofix/diff.rs:1814— doc/src/autofix/diff.rs:1814-1827 | doc/src/autofix/diff.rs:1883-1894 — both copies are in the same file, so extract the 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–14 lines × 2) doc/src/codegen/v2/lang_d/model.rs:817— doc/src/codegen/v2/lang_d/model.rs:817-828 | doc/src/codegen/v2/lang_swift/model.rs:823-836 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12–14 lines × 2) doc/src/codegen/v2/lang_ruby/types.rs:1020— doc/src/codegen/v2/lang_ruby/types.rs:1020-1033 | doc/src/codegen/v2/lang_ruby/types.rs:1093-1104 — both copies are in the same file, so extract the 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–14 lines × 2) layout/src/solver3/fc.rs:8934— layout/src/solver3/fc.rs:8934-8945 | layout/src/solver3/fc.rs:9472-9485 — both copies are in the same file, so extract the 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–14 lines × 2) layout/src/solver3/getters.rs:4350— layout/src/solver3/getters.rs:4350-4363 | layout/src/solver3/getters.rs:4389-4400 — both copies are in the same file, so extract the 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–14 lines × 2) layout/src/text3/dense.rs:1209— layout/src/text3/dense.rs:1209-1222 | layout/src/text3/dense.rs:1326-1337 — both copies are in the same file, so extract the 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 × 4) dll/src/desktop/shell2/linux/x11/mod.rs:6238— dll/src/desktop/shell2/linux/x11/mod.rs:6238-6249 | dll/src/desktop/shell2/linux/x11/mod.rs:6469-6480 | dll/src/desktop/shell2/windows/mod.rs:1897-1908 | dll/src/desktop/shell2/windows/mod.rs:1964-1975 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) doc/src/autofix/type_index.rs:2295— doc/src/autofix/type_index.rs:2295-2306 | doc/src/autofix/type_index.rs:2342-2353 | doc/src/autofix/type_index.rs:2396-2407 | doc/src/autofix/type_index.rs:2443-2454 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) layout/src/solver3/fc.rs:5938— layout/src/solver3/fc.rs:5938-5949 | layout/src/solver3/fc.rs:5968-5979 | layout/src/solver3/fc.rs:5998-6009 | layout/src/solver3/fc.rs:6028-6039 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) layout/src/widgets/backstage.rs:277— layout/src/widgets/backstage.rs:277-288 | layout/src/widgets/quick_access.rs:322-333 | layout/src/widgets/ribbon.rs:622-633 | layout/src/widgets/statusbar.rs:345-356 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) doc/src/reftest/autodoc.rs:1009— doc/src/reftest/autodoc.rs:1009-1020 | doc/src/reftest/autoreview.rs:629-640 | doc/src/reftest/autoreview.rs:859-871 | doc/src/reftest/autoreview.rs:1782-1793 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 4) dll/src/web/transpiler_remill.rs:7006— dll/src/web/transpiler_remill.rs:7006-7018 | dll/src/web/transpiler_remill.rs:7037-7048 | dll/src/web/transpiler_remill.rs:7067-7078 | dll/src/web/transpiler_remill.rs:7097-7108 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 4) dll/src/desktop/shell2/linux/wayland/screencopy.rs:222— dll/src/desktop/shell2/linux/wayland/screencopy.rs:222-233 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:299-310 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:354-365 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:407-418 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6260— dll/src/desktop/shell2/linux/wayland/mod.rs:6260-6268 | dll/src/desktop/shell2/linux/x11/events.rs:1401-1409 | dll/src/desktop/shell2/macos/events.rs:1154-1162 | dll/src/desktop/shell2/windows/mod.rs:2159-2167 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6297— dll/src/desktop/shell2/linux/wayland/mod.rs:6297-6305 | dll/src/desktop/shell2/linux/x11/events.rs:1438-1446 | dll/src/desktop/shell2/macos/events.rs:1118-1126 | dll/src/desktop/shell2/windows/mod.rs:2202-2210 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) doc/src/reftest/mod.rs:1458— doc/src/reftest/mod.rs:1458-1466 | doc/src/reftest/mod.rs:1469-1477 | doc/src/reftest/mod.rs:1480-1488 | doc/src/reftest/mod.rs:1491-1499 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) layout/src/cpurender/raster.rs:4913— layout/src/cpurender/raster.rs:4913-4921 | layout/src/xml/svg.rs:1868-1876 | layout/src/xml/svg.rs:1885-1893 | layout/src/xml/svg.rs:1909-1917 — 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.
Duplicated block (9 lines × 4) doc/src/codegen/v2/lang_rust.rs:1689— doc/src/codegen/v2/lang_rust.rs:1689-1697 | doc/src/codegen/v2/lang_rust.rs:1717-1728 | doc/src/codegen/v2/lang_rust.rs:1748-1759 | doc/src/codegen/v2/lang_rust.rs:1768-1779 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) core/src/xml.rs:3210— core/src/xml.rs:3210-3220 | core/src/xml.rs:3258-3268 | core/src/xml.rs:3292-3300 | core/src/xml.rs:3326-3336 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) doc/src/codegen/v2/lang_crystal/types.rs:138— doc/src/codegen/v2/lang_crystal/types.rs:138-146 | doc/src/codegen/v2/lang_julia/types.rs:174-182 | doc/src/codegen/v2/lang_odin/types.rs:122-130 | doc/src/codegen/v2/lang_v/types.rs:127-135 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_julia/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2 locations) REDACTED:1923— REDACTED:1923 · REDACTED:1935 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:2352— REDACTED:2352 · REDACTED:2441 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:3137— REDACTED:3137 · REDACTED:3167 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:3582— REDACTED:3582 · REDACTED:3629 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:3828— REDACTED:3828 · REDACTED:3950 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 2 locations) REDACTED:3939— REDACTED:3939 · REDACTED:4479 — both copies are in the same file, so extract the 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 locations) REDACTED:4130— REDACTED:4130 · REDACTED:4230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
CssPropertyCache::build_compact_cache_with_inheritance_debug (cyclomatic 98) core/src/compact.rs:503— CssPropertyCache::build_compact_cache_with_inheritance_debug has cyclomatic complexity 98 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CssPropertyCache::get_computed_css_style_string (cyclomatic 85) core/src/prop_cache.rs:2149— CssPropertyCache::get_computed_css_style_string has cyclomatic complexity 85 (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.
CssPropertyCache::restyle (cyclomatic 77) core/src/prop_cache.rs:1570— CssPropertyCache::restyle has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CssPropertyCache::build_compact_cache (cyclomatic 63) core/src/compact.rs:57— CssPropertyCache::build_compact_cache has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CssPropertyCache::get_property_slow (cyclomatic 55) core/src/prop_cache.rs:2783— CssPropertyCache::get_property_slow has cyclomatic complexity 55 (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.
CssPropertyCache::generate_tag_ids (cyclomatic 23) core/src/prop_cache.rs:1960— CssPropertyCache::generate_tag_ids 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. This is NOT this file's highest cyclomatic complexity: CssPropertyCache::resolve_property_dependency (cyclomatic 45) 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.
PythonGenerator::generate_pymethod (cyclomatic 70) doc/src/codegen/v2/lang_python.rs:2467— PythonGenerator::generate_pymethod has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PythonGenerator::generate_callback_trampoline (cyclomatic 38) doc/src/codegen/v2/lang_python.rs:1075— PythonGenerator::generate_callback_trampoline has cyclomatic complexity 38 (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.
PythonGenerator::field_type_needs_unsendable (cyclomatic 35) doc/src/codegen/v2/lang_python.rs:3564— PythonGenerator::field_type_needs_unsendable 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.
PythonGenerator::function_has_unsupported_args (cyclomatic 35) doc/src/codegen/v2/lang_python.rs:3771— PythonGenerator::function_has_unsupported_args 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.
PythonGenerator::is_python_compatible_type (cyclomatic 22) doc/src/codegen/v2/lang_python.rs:4009— PythonGenerator::is_python_compatible_type 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.
PythonGenerator::generate_enum_pymethods (cyclomatic 17) doc/src/codegen/v2/lang_python.rs:2316— PythonGenerator::generate_enum_pymethods 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.
MacOSWindow::render_and_present_in_draw_rect (cyclomatic 56) dll/src/desktop/shell2/macos/mod.rs:7700— MacOSWindow::render_and_present_in_draw_rect 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.
MacOSWindow::new_with_options_internal (cyclomatic 42) dll/src/desktop/shell2/macos/mod.rs:4965— MacOSWindow::new_with_options_internal has cyclomatic complexity 42 (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.
MacOSWindow::sync_window_state (cyclomatic 40) dll/src/desktop/shell2/macos/mod.rs:6307— MacOSWindow::sync_window_state 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.
MacOSWindow::apply_background_material (cyclomatic 21) dll/src/desktop/shell2/macos/mod.rs:6875— MacOSWindow::apply_background_material 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: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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.
MacOSWindow::handle_scroll_wheel (cyclomatic 20) dll/src/desktop/shell2/macos/events.rs:459— MacOSWindow::handle_scroll_wheel 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.
MacOSWindow::initialize_display_link (cyclomatic 17) dll/src/desktop/shell2/macos/mod.rs:4724— MacOSWindow::initialize_display_link has cyclomatic complexity 17 (threshold 15). 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 items inside it that branch (mark_views_dirty_on_main, display_link_callback). 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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.
RustGenerator::generate_transmute_trait_impls_enum (cyclomatic 23) doc/src/codegen/v2/lang_rust.rs:2963— RustGenerator::generate_transmute_trait_impls_enum 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.
RustGenerator::generate_transmute_trait_impls (cyclomatic 21) doc/src/codegen/v2/lang_rust.rs:2733— RustGenerator::generate_transmute_trait_impls has cyclomatic complexity 21 (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.
RustGenerator::generate_method (cyclomatic 20) doc/src/codegen/v2/lang_rust.rs:2116— RustGenerator::generate_method 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.
RustGenerator::generate_trait_impls (cyclomatic 19) doc/src/codegen/v2/lang_rust.rs:302— RustGenerator::generate_trait_impls 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.
RustGenerator::generate_abi_derived_trait_impls (cyclomatic 17) doc/src/codegen/v2/lang_rust.rs:3586— RustGenerator::generate_abi_derived_trait_impls 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.
RustGenerator::generate_result_convenience_methods (cyclomatic 16) doc/src/codegen/v2/lang_rust.rs:1387— RustGenerator::generate_result_convenience_methods 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.
CGenerator::generate_monomorphized_type (cognitive 22) doc/src/codegen/v2/lang_c.rs:513— CGenerator::generate_monomorphized_type has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (10 pts), match/switch 1 (nesting depth added 11). 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.
CGenerator::generate_tagged_union (cognitive 22) doc/src/codegen/v2/lang_c.rs:764— CGenerator::generate_tagged_union has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (9 pts), match/switch 2 (4 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CGenerator::generate_types (cognitive 20) doc/src/codegen/v2/lang_c.rs:203— CGenerator::generate_types has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5, match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CGenerator::generate_forward_declarations (cognitive 20) doc/src/codegen/v2/lang_c.rs:413— CGenerator::generate_forward_declarations has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 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.
CGenerator::generate_union_match_helpers (cognitive 19) doc/src/codegen/v2/lang_c.rs:1374— CGenerator::generate_union_match_helpers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CGenerator::generate_function_declaration (cognitive 17) doc/src/codegen/v2/lang_c.rs:869— CGenerator::generate_function_declaration has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (4 pts), loops 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×6
Duplicated block (14–16 lines × 2) doc/src/codegen/v2/lang_python.rs:3242— doc/src/codegen/v2/lang_python.rs:3242-3255 | doc/src/codegen/v2/lang_python.rs:3259-3274 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) doc/src/main.rs:2578— doc/src/main.rs:2578-2593 | doc/src/main.rs:2597-2610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) doc/src/codegen/v2/lang_csharp/types.rs:732— doc/src/codegen/v2/lang_csharp/types.rs:732-747 | doc/src/codegen/v2/lang_java/types.rs:957-970 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–16 lines × 2) layout/src/solver3/fc.rs:8773— layout/src/solver3/fc.rs:8773-8786 | layout/src/solver3/fc.rs:9269-9284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) layout/src/solver3/layout_tree.rs:2126— layout/src/solver3/layout_tree.rs:2126-2141 | layout/src/solver3/layout_tree.rs:2840-2853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) layout/src/window.rs:15743— layout/src/window.rs:15743-15758 | layout/src/window.rs:15781-15794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:2783— dll/src/desktop/shell2/linux/wayland/mod.rs:2783-2796 | dll/src/desktop/shell2/linux/x11/mod.rs:4143-4156 | dll/src/desktop/shell2/windows/mod.rs:1034-1047 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:7030— dll/src/desktop/shell2/linux/x11/mod.rs:7030-7043 | dll/src/desktop/shell2/macos/mod.rs:8329-8342 | dll/src/desktop/shell2/windows/mod.rs:1737-1750 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) doc/src/autofix/mod.rs:3167— doc/src/autofix/mod.rs:3167-3180 | doc/src/autofix/mod.rs:3197-3210 | doc/src/autofix/mod.rs:3226-3239 — 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 (14 lines × 3) doc/src/codegen/v2/generator.rs:70— doc/src/codegen/v2/generator.rs:70-83 | doc/src/codegen/v2/generator.rs:626-639 | doc/src/codegen/v2/generator.rs:646-659 — 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 (14 lines × 3) layout/src/solver3/fc.rs:8778— layout/src/solver3/fc.rs:8778-8791 | layout/src/solver3/fc.rs:9185-9198 | layout/src/solver3/fc.rs:9276-9289 — 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 (14 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:516— doc/src/codegen/v2/lang_cpp/cpp11.rs:516-529 | doc/src/codegen/v2/lang_cpp/cpp17.rs:708-721 | doc/src/codegen/v2/lang_cpp/cpp20.rs:407-420 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6541— dll/src/desktop/shell2/linux/wayland/mod.rs:6541-6551 | dll/src/desktop/shell2/linux/x11/mod.rs:6281-6291 | dll/src/desktop/shell2/macos/mod.rs:6085-6095 | dll/src/desktop/shell2/windows/mod.rs:2234-2244 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:287— doc/src/codegen/v2/lang_cpp/cpp03.rs:287-297 | doc/src/codegen/v2/lang_cpp/cpp11.rs:186-196 | doc/src/codegen/v2/lang_cpp/cpp17.rs:334-344 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1030-1040 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_algol68/wrappers.rs:121— doc/src/codegen/v2/lang_algol68/wrappers.rs:121-131 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:87-97 | doc/src/codegen/v2/lang_pascal/wrappers.rs:129-139 | doc/src/codegen/v2/lang_vb6/wrappers.rs:64-74 — `doc/src/codegen/v2/lang_algol68/wrappers.rs` and `doc/src/codegen/v2/lang_freebasic/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_ada/types.rs:176— doc/src/codegen/v2/lang_ada/types.rs:176-186 | doc/src/codegen/v2/lang_cobol/types.rs:187-197 | doc/src/codegen/v2/lang_fortran/types.rs:138-148 | doc/src/codegen/v2/lang_pascal/types.rs:121-131 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_node/wrappers.rs:355— doc/src/codegen/v2/lang_node/wrappers.rs:355-368 | doc/src/codegen/v2/lang_php/wrappers.rs:75-85 | doc/src/codegen/v2/lang_php/wrappers.rs:87-97 | doc/src/codegen/v2/lang_zig/wrappers.rs:274-287 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 4) doc/src/codegen/v2/lang_rust.rs:1321— doc/src/codegen/v2/lang_rust.rs:1321-1333 | doc/src/codegen/v2/lang_rust.rs:1345-1355 | doc/src/codegen/v2/lang_rust.rs:1674-1685 | doc/src/codegen/v2/lang_rust.rs:1989-2001 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 2) doc/src/reftest/mod.rs:782— doc/src/reftest/mod.rs:782-789 | doc/src/reftest/mod.rs:827-835 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) doc/src/reftest/regression.rs:721— doc/src/reftest/regression.rs:721-728 | doc/src/reftest/regression.rs:2365-2373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) doc/src/codegen/v2/lang_ada/types.rs:424— doc/src/codegen/v2/lang_ada/types.rs:424-431 | doc/src/codegen/v2/lang_ada/types.rs:504-512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) doc/src/codegen/v2/lang_fortran/types.rs:628— doc/src/codegen/v2/lang_fortran/types.rs:628-636 | doc/src/codegen/v2/lang_fortran/types.rs:789-796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) doc/src/codegen/v2/lang_freebasic/types.rs:150— doc/src/codegen/v2/lang_freebasic/types.rs:150-157 | doc/src/codegen/v2/lang_vb6/types.rs:167-175 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8–9 lines × 2) layout/src/xml/mod.rs:389— layout/src/xml/mod.rs:389-396 | layout/src/xml/mod.rs:943-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 5) dll/src/desktop/shell2/android/mod.rs:414— dll/src/desktop/shell2/android/mod.rs:414-419 | dll/src/desktop/shell2/headless/mod.rs:1748-1753 | dll/src/desktop/shell2/headless/mod.rs:1913-1918 | dll/src/desktop/shell2/ios/mod.rs:1813-1818 | dll/src/desktop/shell2/ios/mod.rs:1964-1969 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 5) dll/src/desktop/shell2/linux/x11/mod.rs:4423— dll/src/desktop/shell2/linux/x11/mod.rs:4423-4428 | dll/src/desktop/shell2/linux/x11/mod.rs:4785-4790 | dll/src/desktop/shell2/linux/x11/mod.rs:5600-5605 | dll/src/desktop/shell2/linux/x11/mod.rs:5640-5645 | dll/src/desktop/shell2/linux/x11/mod.rs:7930-7935 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) dll/src/web/transpiler_remill.rs:1641— dll/src/web/transpiler_remill.rs:1641-1646 | dll/src/web/transpiler_remill.rs:1665-1670 | dll/src/web/transpiler_remill.rs:1691-1696 | dll/src/web/transpiler_remill.rs:1722-1727 | dll/src/web/transpiler_remill.rs:1794-1799 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 5) doc/src/codegen/v2/lang_cpp/cpp11.rs:38— doc/src/codegen/v2/lang_cpp/cpp11.rs:38-49 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-37 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-47 | doc/src/codegen/v2/lang_cpp/cpp20.rs:47-57 | doc/src/codegen/v2/lang_cpp/cpp20.rs:443-448 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 5) doc/src/codegen/v2/lang_crystal/types.rs:172— doc/src/codegen/v2/lang_crystal/types.rs:172-177 | doc/src/codegen/v2/lang_d/types.rs:138-143 | doc/src/codegen/v2/lang_julia/types.rs:217-222 | doc/src/codegen/v2/lang_odin/types.rs:156-161 | doc/src/codegen/v2/lang_v/types.rs:162-167 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 5) doc/src/codegen/v2/lang_csharp/types.rs:349— doc/src/codegen/v2/lang_csharp/types.rs:349-355 | doc/src/codegen/v2/lang_lisp/types.rs:251-258 | doc/src/codegen/v2/lang_node/types.rs:390-397 | doc/src/codegen/v2/lang_racket/types.rs:204-213 | doc/src/codegen/v2/lang_smalltalk/types.rs:195-200 — `doc/src/codegen/v2/lang_lisp/types.rs` and `doc/src/codegen/v2/lang_racket/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 4) dll/src/desktop/compositor2.rs:670— dll/src/desktop/compositor2.rs:670-675 | dll/src/desktop/compositor2.rs:1417-1422 | dll/src/desktop/wr_translate2.rs:1829-1834 | dll/src/desktop/wr_translate2.rs:1870-1875 — 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.
Duplicated block (6 lines × 4) dll/src/desktop/compositor2.rs:682— dll/src/desktop/compositor2.rs:682-687 | dll/src/desktop/compositor2.rs:1429-1434 | dll/src/desktop/wr_translate2.rs:1841-1846 | dll/src/desktop/wr_translate2.rs:1882-1887 — 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.
Duplicated block (6 lines × 4) doc/src/codegen/v2/lang_crystal/types.rs:328— doc/src/codegen/v2/lang_crystal/types.rs:328-333 | doc/src/codegen/v2/lang_julia/types.rs:315-320 | doc/src/codegen/v2/lang_odin/types.rs:274-279 | doc/src/codegen/v2/lang_v/types.rs:282-287 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_julia/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 4) layout/src/widgets/capture_common.rs:111— layout/src/widgets/capture_common.rs:111-116 | layout/src/widgets/map.rs:1318-1323 | layout/src/widgets/map.rs:1357-1362 | layout/src/widgets/microphone.rs:75-80 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) layout/src/widgets/quick_access.rs:379— layout/src/widgets/quick_access.rs:379-384 | layout/src/widgets/quick_access.rs:422-427 | layout/src/widgets/statusbar.rs:404-409 | layout/src/widgets/statusbar.rs:452-457 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/statusbar.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 106 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) core/src/xml.rs:3194— core/src/xml.rs:3194-3201 | core/src/xml.rs:3249-3256 | core/src/xml.rs:3285-3290 | core/src/xml.rs:3315-3320 — 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.
RemillTranspiler::lift_with_transitive_deps_sequential (cyclomatic 86) dll/src/web/transpiler_remill.rs:2167— RemillTranspiler::lift_with_transitive_deps_sequential has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemillTranspiler::produce_object_from_lifted_ir (cyclomatic 70) dll/src/web/transpiler_remill.rs:1272— RemillTranspiler::produce_object_from_lifted_ir has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RemillTranspiler::lift_with_transitive_deps_batched (cyclomatic 55) dll/src/web/transpiler_remill.rs:3387— RemillTranspiler::lift_with_transitive_deps_batched 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.
RemillTranspiler::lift_fn (cyclomatic 21) dll/src/web/transpiler_remill.rs:1013— RemillTranspiler::lift_fn 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: azul_dll::web::transpiler_remill::signature_for_eventloop_fn (cyclomatic 24) 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.
RemillTranspiler::emit_indirect_dispatcher_obj (cyclomatic 21) dll/src/web/transpiler_remill.rs:3039— RemillTranspiler::emit_indirect_dispatcher_obj 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: azul_dll::web::transpiler_remill::signature_for_eventloop_fn (cyclomatic 24) 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.
IRBuilder::validate_api_json (cognitive 199) doc/src/codegen/v2/ir_builder.rs:100— IRBuilder::validate_api_json has cognitive complexity 199 (threshold 15). Drivers by points: if/else 34 (135 pts), loops 16 (59 pts), boolean chains 5 (nesting depth added 144). Of this number, 187 points are the body's own statements and 12 belong to one function item 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.
IRBuilder::sort_types_by_dependencies (cognitive 96) doc/src/codegen/v2/ir_builder.rs:528— IRBuilder::sort_types_by_dependencies has cognitive complexity 96 (threshold 15). Drivers by points: if/else 17 (57 pts), loops 14 (21 pts), boolean chains 13, match/switch 2 (5 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IRBuilder::build_type_aliases (cognitive 21) doc/src/codegen/v2/ir_builder.rs:1319— IRBuilder::build_type_aliases has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (4 pts), loops 2 (3 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.
IRBuilder::build_api_functions (cognitive 21) doc/src/codegen/v2/ir_builder.rs:1598— IRBuilder::build_api_functions has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), if/else 3 (9 pts), boolean chains 1 (nesting depth added 13). 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.
IRBuilder::determine_method_kind (cognitive 18) doc/src/codegen/v2/ir_builder.rs:1752— IRBuilder::determine_method_kind has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (18 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UnifiedLayout::get_selection_rects (cognitive 76) layout/src/text3/cache.rs:5767— UnifiedLayout::get_selection_rects has cognitive complexity 76 (threshold 15). Drivers by points: if/else 25 (54 pts), loops 5 (11 pts), boolean chains 10, match/switch 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
UnifiedLayout::move_cursor_to_prev_word (cognitive 33) layout/src/text3/cache.rs:6604— UnifiedLayout::move_cursor_to_prev_word has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 2 (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.
UnifiedLayout::get_cursor_rect (cognitive 29) layout/src/text3/cache.rs:5996— UnifiedLayout::get_cursor_rect has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 2 (5 pts), loops 2, 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.
UnifiedLayout::move_cursor_to_next_word (cognitive 18) layout/src/text3/cache.rs:6688— UnifiedLayout::move_cursor_to_next_word has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 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.
UnifiedLayout::hittest_cursor (cognitive 16) layout/src/text3/cache.rs:5687— UnifiedLayout::hittest_cursor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutTreeBuilder::process_node (cognitive 73) layout/src/solver3/layout_tree.rs:2062— LayoutTreeBuilder::process_node has cognitive complexity 73 (threshold 15). Drivers by points: if/else 28 (55 pts), loops 4 (9 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutTreeBuilder::apply_split_previews (cognitive 27) layout/src/solver3/layout_tree.rs:2976— LayoutTreeBuilder::apply_split_previews has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (3 pts), match/switch 1 (2 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.
LayoutTreeBuilder::apply_range_suppression_preview (cognitive 19) layout/src/solver3/layout_tree.rs:3278— LayoutTreeBuilder::apply_range_suppression_preview has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutTreeBuilder::process_block_children (cognitive 18) layout/src/solver3/layout_tree.rs:2408— LayoutTreeBuilder::process_block_children has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayoutTreeBuilder::process_table_level_children (cognitive 16) layout/src/solver3/layout_tree.rs:2505— LayoutTreeBuilder::process_table_level_children has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (7 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.
SymbolCollector::visit_item_fn (cognitive 58) doc/src/patch/parser.rs:279— SymbolCollector::visit_item_fn has cognitive complexity 58 (threshold 15). Drivers by points: if/else 19 (49 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent 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::visit_impl_item_fn (cognitive 56) doc/src/patch/parser.rs:401— SymbolCollector::visit_impl_item_fn has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (47 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent 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::extract_doc (cognitive 34) doc/src/patch/parser.rs:154— SymbolCollector::extract_doc has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (33 pts), loops 1 (nesting depth added 26). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SymbolCollector::current_module_path (cognitive 19) doc/src/patch/parser.rs:38— SymbolCollector::current_module_path has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SymbolCollector::visit_item_struct (cognitive 19) doc/src/patch/parser.rs:191— SymbolCollector::visit_item_struct has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (6 pts) (nesting depth added 13). 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.
Model::new (cognitive 37) doc/src/codegen/v2/lang_d/model.rs:245— Model::new has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 5 (10 pts), loops 5, 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.
Model::new (cognitive 29) doc/src/codegen/v2/lang_swift/model.rs:254— Model::new has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (7 pts), loops 4, 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.
Model::new (cognitive 27) doc/src/codegen/v2/lang_crystal/model.rs:211— Model::new has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 3 (7 pts), loops 4, 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.
Model::classify (cognitive 23) doc/src/codegen/v2/lang_swift/model.rs:476— Model::classify has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (4 pts), boolean chains 2, 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.
Model::classify (cognitive 16) doc/src/codegen/v2/lang_d/model.rs:497— Model::classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceCache::update_texture_cache (cognitive 31) webrender/core/src/resource_cache.rs:1387— ResourceCache::update_texture_cache has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 3 (8 pts), loops 2 (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.
ResourceCache::save_capture (cognitive 30) webrender/core/src/resource_cache.rs:1931— ResourceCache::save_capture has cognitive complexity 30 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 6 (10 pts), loops 4 (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ResourceCache::post_scene_building_update (cognitive 26) webrender/core/src/resource_cache.rs:613— ResourceCache::post_scene_building_update has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 3 (6 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ResourceCache::request_image (cognitive 23) webrender/core/src/resource_cache.rs:954— ResourceCache::request_image has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 6 (9 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.
ResourceCache::load_capture (cognitive 22) webrender/core/src/resource_cache.rs:2146— ResourceCache::load_capture has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4 (8 pts), loops 3 (nesting depth added 10). 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.
StyledDom::restyle_on_state_change (cognitive 29) core/src/styled_dom.rs:2153— StyledDom::restyle_on_state_change has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (26 pts), loops 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.
StyledDom::create_from_compact_dom (cognitive 21) core/src/styled_dom.rs:1301— StyledDom::create_from_compact_dom has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StyledDom::restyle_user_property (cognitive 18) core/src/styled_dom.rs:2269— StyledDom::restyle_user_property has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 1 (3 pts), boolean chains 1, loops 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.
StyledDom::append_child_with_index (cognitive 16) core/src/styled_dom.rs:1553— StyledDom::append_child_with_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 5 (6 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.
StyledDom::get_html_string (cognitive 16) core/src/styled_dom.rs:2661— StyledDom::get_html_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 5 (8 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.
Duplicated block (25 lines × 2) core/src/gamepad.rs:203— core/src/gamepad.rs:203-227 | core/src/gamepad.rs:236-260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) dll/src/desktop/shell2/android/mod.rs:225— dll/src/desktop/shell2/android/mod.rs:225-249 | dll/src/desktop/shell2/ios/mod.rs:1743-1767 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (25 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3306— dll/src/desktop/shell2/linux/wayland/mod.rs:3306-3330 | dll/src/desktop/shell2/linux/x11/mod.rs:4309-4333 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (25 lines × 2) layout/src/solver3/fc.rs:2406— layout/src/solver3/fc.rs:2406-2430 | layout/src/solver3/fc.rs:2502-2526 — both copies are in the same file, so extract the 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 (25 lines × 2) layout/src/widgets/themes/flat.rs:1149— layout/src/widgets/themes/flat.rs:1149-1173 | layout/src/widgets/themes/flora.rs:1541-1565 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–18 lines × 2) doc/src/autofix/discovery/parallel.rs:218— doc/src/autofix/discovery/parallel.rs:218-233 | doc/src/autofix/discovery/workspace.rs:246-263 — 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 (16–18 lines × 2) doc/src/codegen/v2/lang_crystal/wrappers.rs:522— doc/src/codegen/v2/lang_crystal/wrappers.rs:522-539 | doc/src/codegen/v2/lang_crystal/wrappers.rs:551-566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:1316— doc/src/codegen/v2/lang_lua/wrappers.rs:1316-1331 | doc/src/codegen/v2/lang_lua/wrappers.rs:1453-1470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–18 lines × 2) doc/src/codegen/v2/transmute_helpers.rs:259— doc/src/codegen/v2/transmute_helpers.rs:259-276 | doc/src/codegen/v2/transmute_helpers.rs:289-304 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–18 lines × 2) layout/src/cpurender/pixmap.rs:1315— layout/src/cpurender/pixmap.rs:1315-1332 | layout/src/cpurender/pixmap.rs:1427-1442 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:264— doc/src/codegen/v2/lang_lua/wrappers.rs:264-281 | doc/src/codegen/v2/lang_lua/wrappers.rs:458-471 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–18 lines × 2) doc/src/codegen/v2/lang_lua/wrappers.rs:1109— doc/src/codegen/v2/lang_lua/wrappers.rs:1109-1126 | doc/src/codegen/v2/lang_lua/wrappers.rs:1175-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–18 lines × 2) doc/src/codegen/v2/lang_ruby/types.rs:324— doc/src/codegen/v2/lang_ruby/types.rs:324-341 | doc/src/codegen/v2/lang_ruby/types.rs:647-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–18 lines × 2) doc/src/utils/analyze.rs:285— doc/src/utils/analyze.rs:285-298 | doc/src/utils/analyze.rs:314-331 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–18 lines × 2) layout/src/managers/gesture.rs:1053— layout/src/managers/gesture.rs:1053-1070 | layout/src/managers/gesture.rs:1181-1194 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 3) dll/src/desktop/display.rs:1112— dll/src/desktop/display.rs:1112-1127 | dll/src/desktop/display.rs:1184-1199 | dll/src/desktop/display.rs:1270-1285 — 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 (16 lines × 3) doc/src/reftest/autoreview.rs:797— doc/src/reftest/autoreview.rs:797-812 | doc/src/reftest/autoreview.rs:1030-1045 | doc/src/reftest/autoreview.rs:1934-1949 — 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 (16 lines × 3) layout/src/window.rs:2036— layout/src/window.rs:2036-2051 | layout/src/window.rs:4671-4686 | layout/src/window.rs:7765-7780 — 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 (16 lines × 3) webrender/core/src/prim_store/picture.rs:671— webrender/core/src/prim_store/picture.rs:671-686 | webrender/core/src/prim_store/picture.rs:701-716 | webrender/core/src/prim_store/picture.rs:731-746 — 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 (16 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:1591— dll/src/desktop/shell2/linux/wayland/mod.rs:1591-1606 | dll/src/desktop/shell2/linux/x11/mod.rs:7852-7867 | dll/src/desktop/shell2/windows/mod.rs:7341-7356 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15–16 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:147— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:147-162 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:310-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10081— dll/src/desktop/shell2/linux/wayland/mod.rs:10081-10095 | dll/src/desktop/shell2/macos/mod.rs:4158-4173 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) doc/src/codegen/v2/lang_cpp/cpp17.rs:757— doc/src/codegen/v2/lang_cpp/cpp17.rs:757-772 | doc/src/codegen/v2/lang_cpp/cpp17.rs:788-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.
Duplicated block (15–16 lines × 2) doc/src/codegen/v2/lang_java/types.rs:265— doc/src/codegen/v2/lang_java/types.rs:265-279 | doc/src/codegen/v2/lang_java/types.rs:552-567 — both copies are in the same file, so extract the 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) doc/src/codegen/v2/lang_java/types.rs:345— doc/src/codegen/v2/lang_java/types.rs:345-360 | doc/src/codegen/v2/lang_java/types.rs:718-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 4) core/src/xml.rs:8389— core/src/xml.rs:8389-8402 | core/src/xml.rs:8475-8488 | core/src/xml.rs:8680-8693 | core/src/xml.rs:8776-8789 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:302— doc/src/codegen/v2/lang_cpp/cpp03.rs:302-315 | doc/src/codegen/v2/lang_cpp/cpp11.rs:201-214 | doc/src/codegen/v2/lang_cpp/cpp17.rs:349-362 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1045-1058 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:652— doc/src/codegen/v2/lang_cpp/cpp03.rs:652-665 | doc/src/codegen/v2/lang_cpp/cpp11.rs:574-587 | doc/src/codegen/v2/lang_cpp/cpp17.rs:775-788 | doc/src/codegen/v2/lang_cpp/cpp20.rs:880-893 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:520— doc/src/codegen/v2/lang_csharp/wrappers.rs:520-533 | doc/src/codegen/v2/lang_java/wrappers.rs:106-119 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:353-366 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:95-108 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14 lines × 4) doc/src/codegen/v2/lang_python.rs:1470— doc/src/codegen/v2/lang_python.rs:1470-1483 | doc/src/codegen/v2/lang_python.rs:1663-1676 | doc/src/codegen/v2/lang_python.rs:1744-1757 | doc/src/codegen/v2/lang_python.rs:1825-1838 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 2) core/src/callbacks.rs:619— core/src/callbacks.rs:619-629 | core/src/callbacks.rs:649-658 — both copies are in the same file, so extract the 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–11 lines × 2) dll/src/desktop/eyedropper/windows.rs:44— dll/src/desktop/eyedropper/windows.rs:44-53 | dll/src/desktop/shell2/windows/mod.rs:7932-7942 — 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) doc/src/codegen/v2/lang_pascal/types.rs:498— doc/src/codegen/v2/lang_pascal/types.rs:498-508 | doc/src/codegen/v2/lang_pascal/types.rs:619-628 — both copies are in the same file, so extract the 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–11 lines × 2) layout/src/managers/a11y.rs:658— layout/src/managers/a11y.rs:658-668 | layout/src/window.rs:12435-12444 — 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) layout/src/text3/dense.rs:1307— layout/src/text3/dense.rs:1307-1317 | layout/src/text3/dense.rs:1467-1476 — both copies are in the same file, so extract the 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–11 lines × 2) doc/src/autofix/diff.rs:630— doc/src/autofix/diff.rs:630-640 | doc/src/autofix/diff.rs:2251-2259 — both copies are in the same file, so extract the 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–11 lines × 2) doc/src/codegen/v2/lang_haskell/functions.rs:288— doc/src/codegen/v2/lang_haskell/functions.rs:288-296 | doc/src/codegen/v2/lang_haskell/functions.rs:728-738 — both copies are in the same file, so extract the 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–11 lines × 2) doc/src/codegen/v2/lang_swift/wrappers.rs:2929— doc/src/codegen/v2/lang_swift/wrappers.rs:2929-2937 | doc/src/codegen/v2/lang_swift/wrappers.rs:2952-2962 — both copies are in the same file, so extract the 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–11 lines × 2) layout/src/cpurender/pixmap.rs:228— layout/src/cpurender/pixmap.rs:228-238 | layout/src/cpurender/pixmap.rs:432-440 — both copies are in the same file, so extract the 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–11 lines × 2) layout/src/solver3/fc.rs:7524— layout/src/solver3/fc.rs:7524-7534 | layout/src/solver3/fc.rs:7633-7641 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 5) css/src/system.rs:815— css/src/system.rs:815-824 | css/src/system.rs:842-851 | css/src/system.rs:869-878 | css/src/system.rs:905-914 | css/src/system.rs:932-941 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:7189— dll/src/desktop/shell2/linux/wayland/mod.rs:7189-7198 | dll/src/desktop/shell2/linux/x11/mod.rs:6238-6247 | dll/src/desktop/shell2/linux/x11/mod.rs:6469-6478 | dll/src/desktop/shell2/windows/mod.rs:1897-1906 | dll/src/desktop/shell2/windows/mod.rs:1964-1973 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 5) doc/src/codegen/v2/lang_csharp/wrappers.rs:552— doc/src/codegen/v2/lang_csharp/wrappers.rs:552-561 | doc/src/codegen/v2/lang_haskell/types.rs:482-491 | doc/src/codegen/v2/lang_java/wrappers.rs:968-977 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:381-390 | doc/src/codegen/v2/lang_ruby/wrappers.rs:644-653 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 5) layout/src/callbacks.rs:3468— layout/src/callbacks.rs:3468-3477 | layout/src/callbacks.rs:3493-3502 | layout/src/callbacks.rs:3518-3527 | layout/src/callbacks.rs:3543-3552 | layout/src/callbacks.rs:3568-3577 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) layout/src/dialogs/crash_reporter.rs:295— layout/src/dialogs/crash_reporter.rs:295-304 | layout/src/dialogs/gpu_check.rs:384-393 | layout/src/dialogs/report_problem.rs:698-707 | layout/src/dialogs/telemetry_consent.rs:297-306 | layout/src/dialogs/update_version.rs:424-433 — before extracting anything, compare `layout/src/dialogs/crash_reporter.rs` and `layout/src/dialogs/report_problem.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) core/src/resources.rs:2649— core/src/resources.rs:2649-2656 | core/src/resources.rs:2710-2717 | core/src/resources.rs:2762-2769 | core/src/resources.rs:2841-2848 | core/src/resources.rs:2909-2916 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) dll/src/desktop/shell2/linux/wayland/defines.rs:2067— dll/src/desktop/shell2/linux/wayland/defines.rs:2067-2074 | dll/src/desktop/shell2/linux/wayland/defines.rs:2199-2206 | dll/src/desktop/shell2/linux/wayland/defines.rs:2381-2388 | dll/src/desktop/shell2/linux/wayland/defines.rs:2891-2898 | dll/src/desktop/shell2/linux/wayland/defines.rs:3058-3065 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 5) doc/src/codegen/v2/lang_rust.rs:2895— doc/src/codegen/v2/lang_rust.rs:2895-2902 | doc/src/codegen/v2/lang_rust.rs:2917-2927 | doc/src/codegen/v2/lang_rust.rs:2935-2942 | doc/src/codegen/v2/rust/static_binding.rs:375-385 | doc/src/codegen/v2/rust/static_binding.rs:418-428 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:10903— dll/src/desktop/shell2/linux/wayland/mod.rs:10903-10912 | dll/src/desktop/shell2/linux/wayland/mod.rs:11034-11043 | dll/src/desktop/shell2/linux/x11/mod.rs:8660-8669 | dll/src/desktop/shell2/linux/x11/mod.rs:8785-8794 | dll/src/desktop/tray/linux.rs:1178-1185 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 5) doc/src/codegen/v2/lang_crystal/types.rs:179— doc/src/codegen/v2/lang_crystal/types.rs:179-186 | doc/src/codegen/v2/lang_d/types.rs:145-152 | doc/src/codegen/v2/lang_julia/types.rs:224-231 | doc/src/codegen/v2/lang_odin/types.rs:163-170 | doc/src/codegen/v2/lang_v/types.rs:169-176 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 4) dll/src/desktop/shell2/common/debug_server/platform.rs:187— dll/src/desktop/shell2/common/debug_server/platform.rs:187-194 | dll/src/desktop/shell2/common/debug_server/platform.rs:399-406 | dll/src/desktop/shell2/common/debug_server/platform.rs:432-439 | dll/src/desktop/shell2/common/debug_server/platform.rs:458-465 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) doc/src/autofix/type_index.rs:2266— doc/src/autofix/type_index.rs:2266-2273 | doc/src/autofix/type_index.rs:2313-2320 | doc/src/autofix/type_index.rs:2368-2375 | doc/src/autofix/type_index.rs:2414-2421 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:338— doc/src/codegen/v2/lang_cpp/cpp03.rs:338-345 | doc/src/codegen/v2/lang_cpp/cpp11.rs:245-252 | doc/src/codegen/v2/lang_cpp/cpp17.rs:402-409 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1079-1086 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) layout/src/widgets/themes/flat.rs:906— layout/src/widgets/themes/flat.rs:906-913 | layout/src/widgets/themes/flat.rs:1581-1588 | layout/src/widgets/themes/flora.rs:1178-1185 | layout/src/widgets/themes/flora.rs:2000-2007 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) layout/src/widgets/backstage.rs:1059— layout/src/widgets/backstage.rs:1059-1066 | layout/src/widgets/quick_access.rs:1036-1043 | layout/src/widgets/ribbon.rs:3601-3608 | layout/src/widgets/statusbar.rs:1483-1490 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) css/src/system.rs:2222— css/src/system.rs:2222-2226 | css/src/system.rs:2274-2278 | css/src/system.rs:2326-2330 | css/src/system.rs:2378-2382 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) css/src/system.rs:2689— css/src/system.rs:2689-2693 | css/src/system.rs:2896-2900 | css/src/system.rs:2945-2949 | css/src/system.rs:2994-2998 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 4) doc/src/codegen/v2/lang_crystal/functions.rs:91— doc/src/codegen/v2/lang_crystal/functions.rs:91-95 | doc/src/codegen/v2/lang_d/functions.rs:53-57 | doc/src/codegen/v2/lang_odin/functions.rs:63-67 | doc/src/codegen/v2/lang_v/functions.rs:82-86 — `doc/src/codegen/v2/lang_crystal/functions.rs` and `doc/src/codegen/v2/lang_v/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 30 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 4) layout/src/widgets/breadcrumb.rs:216— layout/src/widgets/breadcrumb.rs:216-220 | layout/src/widgets/radio_group.rs:402-406 | layout/src/widgets/segmented.rs:348-352 | layout/src/widgets/stepper.rs:425-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 4 call sites, so a change lands once.
Duplicated block (5 lines × 4) css/src/system.rs:809— css/src/system.rs:809-813 | css/src/system.rs:836-840 | css/src/system.rs:863-867 | css/src/system.rs:926-930 — 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.
TileCacheInstance::update_prim_dependencies (cyclomatic 80) webrender/core/src/picture.rs:3038— TileCacheInstance::update_prim_dependencies has cyclomatic complexity 80 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TileCacheInstance::pre_update (cyclomatic 47) webrender/core/src/picture.rs:2047— TileCacheInstance::pre_update 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.
TileCacheInstance::post_update (cyclomatic 24) webrender/core/src/picture.rs:3850— TileCacheInstance::post_update has cyclomatic 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.
TileCacheInstance::setup_compositor_surfaces_impl (cyclomatic 21) webrender/core/src/picture.rs:2710— TileCacheInstance::setup_compositor_surfaces_impl 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: PictureCompositeMode::kind (cyclomatic 24) 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.
Win32Window::render_and_present (cyclomatic 74) dll/src/desktop/shell2/windows/mod.rs:1139— Win32Window::render_and_present 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.
Win32Window::sync_window_state (cyclomatic 35) dll/src/desktop/shell2/windows/mod.rs:2724— Win32Window::sync_window_state 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.
Win32Window::new (cyclomatic 29) dll/src/desktop/shell2/windows/mod.rs:300— Win32Window::new 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::windows::win32_msg_name (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 function is counted neither in this dimension's figures nor in its score.
Win32Window::feed_pointer (cyclomatic 19) dll/src/desktop/shell2/windows/mod.rs:3591— Win32Window::feed_pointer 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: azul_dll::desktop::shell2::windows::win32_msg_name (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 function is counted neither in this dimension's figures nor in its score.
PicturePrimitive::take_context (cognitive 294) webrender/core/src/picture.rs:5302— PicturePrimitive::take_context has cognitive complexity 294 (threshold 15). Drivers by points: if/else 50 (211 pts), loops 8 (39 pts), match/switch 14 (39 pts), boolean chains 5 (nesting depth added 217). 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.
PicturePrimitive::prepare_for_render (cognitive 30) webrender/core/src/picture.rs:7265— PicturePrimitive::prepare_for_render has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (8 pts), match/switch 4 (7 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PicturePrimitive::assign_surface (cognitive 25) webrender/core/src/picture.rs:6945— PicturePrimitive::assign_surface has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PicturePrimitive::propagate_bounding_rect (cognitive 20) webrender/core/src/picture.rs:7185— PicturePrimitive::propagate_bounding_rect has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CssPropertyWithConditionsVec::parse_at_rule (cognitive 67) css/src/dynamic_selector.rs:2260— CssPropertyWithConditionsVec::parse_at_rule has cognitive complexity 67 (threshold 15). Drivers by points: if/else 28 (58 pts), match/switch 2 (6 pts), boolean chains 3 (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.
CssPropertyWithConditionsVec::parse_media_query (cognitive 28) css/src/dynamic_selector.rs:2419— CssPropertyWithConditionsVec::parse_media_query has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (23 pts), match/switch 2 (4 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.
CssPropertyWithConditionsVec::parse_with_conditions (cognitive 22) css/src/dynamic_selector.rs:2075— CssPropertyWithConditionsVec::parse_with_conditions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (18 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.
CssPropertyWithConditionsVec::parse_media_feature_inline (cognitive 19) css/src/dynamic_selector.rs:2490— CssPropertyWithConditionsVec::parse_media_feature_inline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 2, match/switch 1 (nesting depth added 4). 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.
DenseText::from_unified_with_content (cognitive 46) layout/src/text3/dense.rs:223— DenseText::from_unified_with_content has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 4, loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DenseText::move_cursor_to_prev_word (cognitive 24) layout/src/text3/dense.rs:638— DenseText::move_cursor_to_prev_word has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 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.
DenseText::to_unified_items (cognitive 21) layout/src/text3/dense.rs:748— DenseText::to_unified_items has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (9 pts), match/switch 2 (6 pts), if/else 2 (4 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.
DenseText::hittest_cursor (cognitive 19) layout/src/text3/dense.rs:930— DenseText::hittest_cursor has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), 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.
RenderBackend::update_document (cognitive 33) webrender/core/src/render_backend.rs:1327— RenderBackend::update_document has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (25 pts), boolean chains 4, loops 2, 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.
RenderBackend::process_api_msg (cognitive 30) webrender/core/src/render_backend.rs:953— RenderBackend::process_api_msg has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (11 pts), match/switch 2 (3 pts) (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RenderBackend::process_transaction (cognitive 25) webrender/core/src/render_backend.rs:842— RenderBackend::process_transaction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderBackend::process_scene_builder_result (cognitive 18) webrender/core/src/render_backend.rs:1139— RenderBackend::process_scene_builder_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (28 lines × 2) doc/src/codegen/v2/lang_cpp/cpp03.rs:176— doc/src/codegen/v2/lang_cpp/cpp03.rs:176-203 | doc/src/codegen/v2/lang_cpp/cpp17.rs:197-224 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 26 separate duplicated blocks between them, totalling at least 450 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) doc/src/autofix/debug.rs:1206— doc/src/autofix/debug.rs:1206-1233 | doc/src/autofix/debug.rs:1271-1298 — both copies are in the same file, so extract the 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 (28 lines × 2) layout/src/text3/cache.rs:7240— layout/src/text3/cache.rs:7240-7267 | layout/src/text3/dense.rs:782-809 — before extracting anything, compare `layout/src/text3/cache.rs` and `layout/src/text3/dense.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 2) dll/src/web/transpiler_remill.rs:505— dll/src/web/transpiler_remill.rs:505-532 | dll/src/web/transpiler_remill.rs:542-571 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 3) core/src/transform.rs:520— core/src/transform.rs:520-540 | core/src/transform.rs:542-562 | core/src/transform.rs:564-584 — 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 (21 lines × 3) layout/src/solver3/fc.rs:1663— layout/src/solver3/fc.rs:1663-1683 | layout/src/solver3/fc.rs:2409-2429 | layout/src/solver3/fc.rs:2505-2525 — 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 (21 lines × 3) layout/src/widgets/node_graph.rs:3174— layout/src/widgets/node_graph.rs:3174-3194 | layout/src/widgets/node_graph.rs:3236-3256 | layout/src/widgets/node_graph.rs:3329-3349 — 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 (21 lines × 3) layout/src/solver3/display_list.rs:5154— layout/src/solver3/display_list.rs:5154-5176 | layout/src/solver3/display_list.rs:5242-5262 | layout/src/solver3/display_list.rs:5288-5342 — 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 (20–21 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:7091— dll/src/desktop/shell2/linux/x11/mod.rs:7091-7111 | dll/src/desktop/shell2/windows/mod.rs:1787-1806 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20–21 lines × 2) doc/src/autofix/mod.rs:4955— doc/src/autofix/mod.rs:4955-4975 | doc/src/autofix/mod.rs:4994-5013 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) doc/src/autofix/workspace.rs:554— doc/src/autofix/workspace.rs:554-574 | doc/src/autofix/workspace.rs:598-617 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–21 lines × 2) doc/src/patch/mod.rs:841— doc/src/patch/mod.rs:841-861 | doc/src/patch/mod.rs:864-883 — both copies are in the same file, so extract the 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–19 lines × 2) css/src/system.rs:2653— css/src/system.rs:2653-2667 | css/src/system.rs:2854-2872 — both copies are in the same file, so extract the 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–19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3672— dll/src/desktop/shell2/linux/wayland/mod.rs:3672-3690 | dll/src/desktop/shell2/linux/wayland/mod.rs:5377-5391 — both copies are in the same file, so extract the 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–19 lines × 2) dll/src/desktop/shell2/windows/tooltip.rs:217— dll/src/desktop/shell2/windows/tooltip.rs:217-235 | dll/src/desktop/shell2/windows/tooltip.rs:249-263 — both copies are in the same file, so extract the 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–19 lines × 2) dll/src/web/symbol_table.rs:1440— dll/src/web/symbol_table.rs:1440-1454 | dll/src/web/symbol_table.rs:1839-1857 — both copies are in the same file, so extract the 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–18 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10403— dll/src/desktop/shell2/linux/wayland/mod.rs:10403-10420 | dll/src/desktop/shell2/linux/wayland/mod.rs:10674-10688 — both copies are in the same file, so extract the 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–18 lines × 2) doc/src/codegen/v2/lang_fortran/types.rs:482— doc/src/codegen/v2/lang_fortran/types.rs:482-499 | doc/src/codegen/v2/lang_fortran/types.rs:527-541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–18 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:518— doc/src/codegen/v2/lang_cpp/common.rs:518-535 | doc/src/codegen/v2/lang_cpp/common.rs:930-944 — both copies are in the same file, so extract the 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–18 lines × 2) layout/src/solver3/fc.rs:6492— layout/src/solver3/fc.rs:6492-6506 | layout/src/solver3/fc.rs:7970-7987 — both copies are in the same file, so extract the 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–17 lines × 2) dll/src/web/server.rs:695— dll/src/web/server.rs:695-711 | dll/src/web/server.rs:808-822 — both copies are in the same file, so extract the 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–17 lines × 2) layout/src/cpurender/pixmap.rs:1522— layout/src/cpurender/pixmap.rs:1522-1536 | layout/src/cpurender/pixmap.rs:1572-1588 — both copies are in the same file, so extract the 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–17 lines × 2) layout/src/cpurender/pixmap.rs:1554— layout/src/cpurender/pixmap.rs:1554-1570 | layout/src/cpurender/pixmap.rs:1648-1662 — both copies are in the same file, so extract the 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–17 lines × 2) webrender/core/src/renderer/mod.rs:3092— webrender/core/src/renderer/mod.rs:3092-3106 | webrender/core/src/renderer/mod.rs:3272-3288 — both copies are in the same file, so extract the 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–15 lines × 2) dll/src/desktop/shell2/linux/x11/accessibility.rs:88— dll/src/desktop/shell2/linux/x11/accessibility.rs:88-102 | dll/src/desktop/shell2/windows/accessibility.rs:97-108 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12–15 lines × 2) doc/src/codegen/v2/lang_rust.rs:679— doc/src/codegen/v2/lang_rust.rs:679-693 | doc/src/codegen/v2/lang_rust.rs:699-710 — both copies are in the same file, so extract the 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–15 lines × 2) layout/src/cpurender/pixmap.rs:1345— layout/src/cpurender/pixmap.rs:1345-1359 | layout/src/cpurender/pixmap.rs:1450-1461 — both copies are in the same file, so extract the 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–15 lines × 2) layout/src/solver3/mod.rs:633— layout/src/solver3/mod.rs:633-644 | layout/src/solver3/mod.rs:1038-1052 — both copies are in the same file, so extract the 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–13 lines × 4) css/src/system.rs:2609— css/src/system.rs:2609-2621 | css/src/system.rs:2659-2671 | css/src/system.rs:2787-2798 | css/src/system.rs:2864-2876 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) layout/src/cpurender/raster.rs:4258— layout/src/cpurender/raster.rs:4258-4269 | layout/src/cpurender/raster.rs:4275-4287 | layout/src/cpurender/raster.rs:4293-4305 | layout/src/cpurender/raster.rs:4311-4323 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) layout/src/widgets/node_graph.rs:2019— layout/src/widgets/node_graph.rs:2019-2031 | layout/src/widgets/node_graph.rs:2042-2054 | layout/src/widgets/node_graph.rs:2065-2077 | layout/src/widgets/node_graph.rs:2088-2099 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) layout/src/widgets/node_graph.rs:2143— layout/src/widgets/node_graph.rs:2143-2155 | layout/src/widgets/node_graph.rs:2166-2178 | layout/src/widgets/node_graph.rs:2189-2201 | layout/src/widgets/node_graph.rs:2212-2223 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–13 lines × 2) dll/src/desktop/extra/hid/macos.rs:285— dll/src/desktop/extra/hid/macos.rs:285-297 | dll/src/desktop/extra/hid/windows.rs:220-230 — 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–13 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:1651— dll/src/desktop/shell2/linux/x11/mod.rs:1651-1661 | dll/src/desktop/shell2/linux/x11/mod.rs:1703-1715 — both copies are in the same file, so extract the 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–13 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:591— doc/src/codegen/v2/lang_go/wrappers.rs:591-603 | doc/src/codegen/v2/lang_go/wrappers.rs:620-630 — both copies are in the same file, so extract the 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–13 lines × 2) webrender/core/src/picture.rs:1919— webrender/core/src/picture.rs:1919-1931 | webrender/core/src/picture.rs:1964-1974 — both copies are in the same file, so extract the 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–12 lines × 2) dll/src/web/symbol_table.rs:562— dll/src/web/symbol_table.rs:562-573 | dll/src/web/transpiler_remill.rs:5256-5265 — 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–12 lines × 2) doc/src/codegen/v2/lang_csharp/managed.rs:752— doc/src/codegen/v2/lang_csharp/managed.rs:752-763 | doc/src/codegen/v2/lang_csharp/managed.rs:959-968 — both copies are in the same file, so extract the 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–12 lines × 2) doc/src/codegen/v2/lang_crystal/functions.rs:64— doc/src/codegen/v2/lang_crystal/functions.rs:64-73 | doc/src/codegen/v2/lang_crystal/functions.rs:97-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) layout/src/solver3/sizing.rs:1385— layout/src/solver3/sizing.rs:1385-1394 | layout/src/solver3/sizing.rs:1418-1429 — both copies are in the same file, so extract the 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–11 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:7526— dll/src/desktop/shell2/linux/wayland/mod.rs:7526-7535 | dll/src/desktop/shell2/linux/x11/mod.rs:6582-6592 | dll/src/desktop/shell2/windows/mod.rs:1198-1208 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–11 lines × 3) dll/src/desktop/compositor2.rs:1633— dll/src/desktop/compositor2.rs:1633-1642 | dll/src/desktop/compositor2.rs:1825-1834 | dll/src/desktop/compositor2.rs:1941-1951 — 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–11 lines × 3) doc/src/codegen/v2/lang_kotlin/mod.rs:582— doc/src/codegen/v2/lang_kotlin/mod.rs:582-592 | doc/src/codegen/v2/lang_kotlin/mod.rs:648-657 | doc/src/codegen/v2/lang_kotlin/mod.rs:721-730 — 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–11 lines × 3) layout/src/window.rs:2820— layout/src/window.rs:2820-2829 | layout/src/window.rs:3933-3943 | layout/src/window.rs:4122-4131 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–11 lines × 2) dll/src/desktop/tray/linux.rs:518— dll/src/desktop/tray/linux.rs:518-528 | dll/src/desktop/tray/linux.rs:946-953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–11 lines × 2) dll/src/web/transpiler_remill.rs:1466— dll/src/web/transpiler_remill.rs:1466-1473 | dll/src/web/transpiler_remill.rs:6754-6764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–11 lines × 2) doc/src/main.rs:986— doc/src/main.rs:986-996 | doc/src/main.rs:1231-1238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–11 lines × 2) layout/src/glyph_cache.rs:509— layout/src/glyph_cache.rs:509-519 | layout/src/glyph_cache.rs:1786-1793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:630— doc/src/codegen/v2/lang_haskell/types.rs:630-637 | doc/src/codegen/v2/lang_haskell/types.rs:777-786 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_racket/types.rs:200— doc/src/codegen/v2/lang_racket/types.rs:200-209 | doc/src/codegen/v2/lang_racket/types.rs:339-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_smalltalk/functions.rs:226— doc/src/codegen/v2/lang_smalltalk/functions.rs:226-235 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:260-267 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–10 lines × 2) doc/src/codegen/v2/lang_freebasic/types.rs:181— doc/src/codegen/v2/lang_freebasic/types.rs:181-190 | doc/src/codegen/v2/lang_vb6/types.rs:217-224 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) dll/src/desktop/shell2/linux/wayland/mod.rs:7211— dll/src/desktop/shell2/linux/wayland/mod.rs:7211-7219 | dll/src/desktop/shell2/linux/x11/mod.rs:6548-6556 | dll/src/desktop/shell2/linux/x11/mod.rs:6946-6954 | dll/src/desktop/shell2/windows/mod.rs:1168-1176 | dll/src/desktop/shell2/windows/mod.rs:1658-1666 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) dll/src/desktop/extra/biometric/android.rs:140— dll/src/desktop/extra/biometric/android.rs:140-148 | dll/src/desktop/extra/geolocation/android.rs:109-117 | dll/src/desktop/extra/keyring/android.rs:107-115 | dll/src/desktop/extra/permission/android.rs:147-155 | dll/src/desktop/extra/sensors/android.rs:81-89 — 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.
Duplicated block (9 lines × 5) doc/src/codegen/v2/lang_algol68/wrappers.rs:120— doc/src/codegen/v2/lang_algol68/wrappers.rs:120-128 | doc/src/codegen/v2/lang_cobol/wrappers.rs:88-96 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:86-94 | doc/src/codegen/v2/lang_pascal/wrappers.rs:128-136 | doc/src/codegen/v2/lang_vb6/wrappers.rs:63-71 — `doc/src/codegen/v2/lang_algol68/wrappers.rs` and `doc/src/codegen/v2/lang_freebasic/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 35 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 5) doc/src/dllgen/deploy.rs:1651— doc/src/dllgen/deploy.rs:1651-1659 | doc/src/dllgen/deploy.rs:1663-1671 | doc/src/dllgen/deploy.rs:1675-1683 | doc/src/dllgen/deploy.rs:1698-1706 | doc/src/dllgen/deploy.rs:1715-1723 — 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.
TaffyBridge::translate_style_to_taffy (cyclomatic 74) layout/src/solver3/taffy_bridge.rs:734— TaffyBridge::translate_style_to_taffy 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.
TaffyBridge::compute_non_flex_layout (cyclomatic 36) layout/src/solver3/taffy_bridge.rs:1990— TaffyBridge::compute_non_flex_layout has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TaffyBridge::compute_child_layout (cyclomatic 20) layout/src/solver3/taffy_bridge.rs:1832— TaffyBridge::compute_child_layout 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.
PictureCompositeMode::get_coverage_target_svgfe (cyclomatic 59) webrender/core/src/picture.rs:4634— PictureCompositeMode::get_coverage_target_svgfe has cyclomatic complexity 59 (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.
PictureCompositeMode::get_rect (cyclomatic 18) webrender/core/src/picture.rs:4315— PictureCompositeMode::get_rect has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (PictureCompositeMode::get_coverage) 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. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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.
PictureCompositeMode::get_coverage (cyclomatic 18) webrender/core/src/picture.rs:4450— PictureCompositeMode::get_coverage has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This shape REPEATS in the file: one other method here (PictureCompositeMode::get_rect) 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. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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.
IRBuilder::validate_api_json (cyclomatic 54) doc/src/codegen/v2/ir_builder.rs:100— IRBuilder::validate_api_json has cyclomatic complexity 54 (threshold 15). Of this number, 47 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
IRBuilder::sort_types_by_dependencies (cyclomatic 49) doc/src/codegen/v2/ir_builder.rs:528— IRBuilder::sort_types_by_dependencies 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.
IRBuilder::build_monomorphized_def (cyclomatic 16) doc/src/codegen/v2/ir_builder.rs:1389— IRBuilder::build_monomorphized_def 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.
AutofixPatch::modify_to_class_patch (cyclomatic 43) doc/src/autofix/patch_format.rs:951— AutofixPatch::modify_to_class_patch has cyclomatic complexity 43 (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.
AutofixPatch::to_api_patch_with_context (cyclomatic 23) doc/src/autofix/patch_format.rs:675— AutofixPatch::to_api_patch_with_context 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.
AutofixPatch::explain (cyclomatic 16) doc/src/autofix/patch_format.rs:407— AutofixPatch::explain 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.
CompositorState::allocate_layers_from_display_list (cyclomatic 43) layout/src/cpurender/compositor.rs:369— CompositorState::allocate_layers_from_display_list 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.
CompositorState::composite_layer_recursive (cyclomatic 17) layout/src/cpurender/compositor.rs:937— CompositorState::composite_layer_recursive 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.
CompositorState::render_layers (cyclomatic 16) layout/src/cpurender/compositor.rs:706— CompositorState::render_layers 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.
RenderBackend::process_api_msg (cyclomatic 28) webrender/core/src/render_backend.rs:953— RenderBackend::process_api_msg has cyclomatic complexity 28 (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.
RenderBackend::update_document (cyclomatic 25) webrender/core/src/render_backend.rs:1327— RenderBackend::update_document 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.
RenderBackend::process_scene_builder_result (cyclomatic 19) webrender/core/src/render_backend.rs:1139— RenderBackend::process_scene_builder_result 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.
Model::new (cyclomatic 24) doc/src/codegen/v2/lang_d/model.rs:245— Model::new 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::new (cyclomatic 19) doc/src/codegen/v2/lang_swift/model.rs:254— Model::new 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.
Model::new (cyclomatic 18) doc/src/codegen/v2/lang_crystal/model.rs:211— Model::new 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.
SwCompositor::occlude_surfaces (cyclomatic 22) webrender/core/src/compositor/sw_compositor.rs:840— SwCompositor::occlude_surfaces has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 function items 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.
SwCompositor::flush_composites (cyclomatic 17) webrender/core/src/compositor/sw_compositor.rs:1130— SwCompositor::flush_composites 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.
SwCompositor::start_compositing (cyclomatic 16) webrender/core/src/compositor/sw_compositor.rs:1538— SwCompositor::start_compositing 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.
ResourceCache::save_capture (cyclomatic 21) webrender/core/src/resource_cache.rs:1931— ResourceCache::save_capture 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.
ResourceCache::post_scene_building_update (cyclomatic 19) webrender/core/src/resource_cache.rs:613— ResourceCache::post_scene_building_update 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.
ResourceCache::request_image (cyclomatic 17) webrender/core/src/resource_cache.rs:954— ResourceCache::request_image 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.
TaffyBridge::translate_style_to_taffy (cognitive 107) layout/src/solver3/taffy_bridge.rs:734— TaffyBridge::translate_style_to_taffy has cognitive complexity 107 (threshold 15). Drivers by points: if/else 58 (86 pts), match/switch 15 (17 pts), boolean chains 4 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaffyBridge::compute_non_flex_layout (cognitive 52) layout/src/solver3/taffy_bridge.rs:1990— TaffyBridge::compute_non_flex_layout has cognitive complexity 52 (threshold 15). Drivers by points: if/else 16 (29 pts), match/switch 11 (18 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaffyBridge::compute_child_layout (cognitive 27) layout/src/solver3/taffy_bridge.rs:1832— TaffyBridge::compute_child_layout has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 4 (7 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.
CompositorState::allocate_layers_from_display_list (cognitive 77) layout/src/cpurender/compositor.rs:369— CompositorState::allocate_layers_from_display_list has cognitive complexity 77 (threshold 15). Drivers by points: if/else 20 (64 pts), boolean chains 10, match/switch 1 (2 pts), loops 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompositorState::render_layers (cognitive 25) layout/src/cpurender/compositor.rs:706— CompositorState::render_layers has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 5 (8 pts), boolean chains 3 (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.
CompositorState::composite_layer_recursive (cognitive 25) layout/src/cpurender/compositor.rs:937— CompositorState::composite_layer_recursive has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 4, loops 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AutofixPatch::to_api_patch_with_context (cognitive 64) doc/src/autofix/patch_format.rs:675— AutofixPatch::to_api_patch_with_context has cognitive complexity 64 (threshold 15). Drivers by points: if/else 14 (43 pts), loops 7 (19 pts), match/switch 1 (2 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.
AutofixPatch::modify_to_class_patch (cognitive 44) doc/src/autofix/patch_format.rs:951— AutofixPatch::modify_to_class_patch has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 4 (10 pts), match/switch 2 (6 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AutofixPatch::explain (cognitive 37) doc/src/autofix/patch_format.rs:407— AutofixPatch::explain has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (12 pts), match/switch 1 (2 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Device::new (cognitive 62) webrender/core/src/device/gl.rs:1440— Device::new has cognitive complexity 62 (threshold 15). Drivers by points: if/else 27 (33 pts), boolean chains 19, match/switch 8 (9 pts), loops 1 (nesting depth added 7). 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.
Device::link_program (cognitive 42) webrender/core/src/device/gl.rs:2444— Device::link_program has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 24). 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.
Device::bind_texture_impl (cognitive 20) webrender/core/src/device/gl.rs:2242— Device::bind_texture_impl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (7 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeResolver::check_type_c_compatibility_with_index (cognitive 55) doc/src/autofix/type_resolver.rs:434— TypeResolver::check_type_c_compatibility_with_index has cognitive complexity 55 (threshold 15). Drivers by points: if/else 10 (39 pts), loops 2 (9 pts), match/switch 3 (7 pts) (nesting depth added 40). 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.
TypeResolver::resolve_type_with_context (cognitive 26) doc/src/autofix/type_resolver.rs:165— TypeResolver::resolve_type_with_context has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeResolver::resolve_referenced_types (cognitive 23) doc/src/autofix/type_resolver.rs:298— TypeResolver::resolve_referenced_types has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IntrinsicSizeCalculator::calculate_intrinsic_recursive (cognitive 50) layout/src/solver3/sizing.rs:279— IntrinsicSizeCalculator::calculate_intrinsic_recursive has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (45 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 24). 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.
IntrinsicSizeCalculator::calculate_node_intrinsic_sizes (cognitive 48) layout/src/solver3/sizing.rs:512— IntrinsicSizeCalculator::calculate_node_intrinsic_sizes has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (41 pts), boolean chains 6, match/switch 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.
IntrinsicSizeCalculator::calculate_table_intrinsic_sizes (cognitive 28) layout/src/solver3/sizing.rs:1208— IntrinsicSizeCalculator::calculate_table_intrinsic_sizes has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (7 pts), match/switch 1 (2 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.
TextShapingCache::measure_intrinsic_widths (cognitive 38) layout/src/text3/cache.rs:8146— TextShapingCache::measure_intrinsic_widths has cognitive complexity 38 (threshold 15). Drivers by points: if/else 21 (34 pts), boolean chains 3, 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.
TextShapingCache::memory_report (cognitive 25) layout/src/text3/cache.rs:7501— TextShapingCache::memory_report has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (7 pts), match/switch 1 (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.
TextShapingCache::layout_flow (cognitive 18) layout/src/text3/cache.rs:7897— TextShapingCache::layout_flow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts), boolean chains 1, 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.
SymbolTable::assign_synthetic_addresses (cognitive 28) dll/src/web/symbol_table.rs:756— SymbolTable::assign_synthetic_addresses has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 6 (7 pts), match/switch 3 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SymbolTable::enumerate_low32_data_for_wasm (cognitive 20) dll/src/web/symbol_table.rs:513— SymbolTable::enumerate_low32_data_for_wasm has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 2 (6 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.
SymbolTable::build_from_loaded_image (cognitive 18) dll/src/web/symbol_table.rs:582— SymbolTable::build_from_loaded_image has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (6 pts), loops 3 (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.
WorkspaceIndex::find_type_by_string_search_inner (cognitive 27) doc/src/patch/index.rs:697— WorkspaceIndex::find_type_by_string_search_inner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 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.
WorkspaceIndex::deduce_full_path (cognitive 24) doc/src/patch/index.rs:864— WorkspaceIndex::deduce_full_path has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 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.
WorkspaceIndex::build_with_verbosity (cognitive 20) doc/src/patch/index.rs:519— WorkspaceIndex::build_with_verbosity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Near-duplicate member pair (57 shared lines) dll/src/desktop/tray/linux.rs:422— dll/src/desktop/tray/linux.rs:422-547 | dll/src/desktop/tray/linux.rs:782-1007 — These two members are variants of one another: 57 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 (57 shared lines) doc/src/autofix/diff.rs:554— doc/src/autofix/diff.rs:554-697 | doc/src/autofix/diff.rs:2211-2292 — These two members are variants of one another: 57 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 (57 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:3337— dll/src/desktop/shell2/linux/wayland/mod.rs:3337-3447 | dll/src/desktop/shell2/linux/x11/mod.rs:4340-4480 — These two members are variants of one another: 57 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (8 members, 50+ identical tokens) doc/src/codegen/v2/config.rs:357— doc/src/codegen/v2/config.rs:357-431 | doc/src/codegen/v2/lang_crystal/mod.rs:302-364 | doc/src/codegen/v2/lang_freebasic/mod.rs:117-186 | doc/src/codegen/v2/lang_julia/mod.rs:197-255 | doc/src/codegen/v2/lang_nim/mod.rs:146-213 | doc/src/codegen/v2/lang_odin/mod.rs:131-190 | doc/src/codegen/v2/lang_pascal/mod.rs:228-307 | doc/src/codegen/v2/lang_v/mod.rs:155-215 — These 8 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 8 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 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) doc/src/codegen/v2/lang_cpp/cpp03.rs:242— doc/src/codegen/v2/lang_cpp/cpp03.rs:242-400 | doc/src/codegen/v2/lang_cpp/cpp03.rs:678-715 | doc/src/codegen/v2/lang_cpp/cpp11.rs:152-300 | doc/src/codegen/v2/lang_cpp/cpp11.rs:600-637 | doc/src/codegen/v2/lang_cpp/cpp17.rs:283-480 | doc/src/codegen/v2/lang_cpp/cpp17.rs:810-856 | doc/src/codegen/v2/lang_cpp/cpp20.rs:928-987 | doc/src/codegen/v2/lang_cpp/cpp20.rs:996-1158 — These 8 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 8 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 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) layout/src/xml/svg.rs:878— layout/src/xml/svg.rs:878-902 | layout/src/xml/svg.rs:917-941 | layout/src/xml/svg.rs:985-1009 | layout/src/xml/svg.rs:1050-1075 | layout/src/xml/svg.rs:1128-1152 | layout/src/xml/svg.rs:1179-1208 | layout/src/xml/svg.rs:1223-1256 | layout/src/xml/svg.rs:1271-1306 — These 8 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 8 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 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (7 members, 50+ identical tokens) core/src/events.rs:1741— core/src/events.rs:1741-1879 | core/src/events.rs:1888-1974 | core/src/events.rs:2042-2173 | core/src/window.rs:2580-2633 | css/src/props/property.rs:1572-1613 | css/src/props/property.rs:1782-1904 | layout/src/text3/default.rs:652-750 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) doc/src/autofix/patch_format.rs:13— doc/src/autofix/patch_format.rs:13-26 | doc/src/autofix/workspace.rs:2237-2250 | doc/src/codegen/v2/ir.rs:503-516 | doc/src/codegen/v2/ir_builder.rs:2679-2692 | doc/src/codegen/v2/lang_python.rs:4555-4568 | doc/src/codegen/v2/lang_rust.rs:5003-5016 | doc/src/codegen/v2/transmute_helpers.rs:506-519 — These 7 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 7 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 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) doc/src/codegen/v2/lang_java/derives.rs:635— doc/src/codegen/v2/lang_java/derives.rs:635-718 | doc/src/codegen/v2/lang_java/functions.rs:222-262 | doc/src/codegen/v2/lang_java/types.rs:426-469 | doc/src/codegen/v2/lang_java/types.rs:741-800 | doc/src/codegen/v2/lang_java/types.rs:924-976 | doc/src/codegen/v2/lang_java/wrappers.rs:131-443 | doc/src/codegen/v2/lang_java/wrappers.rs:1937-2052 — These 7 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 7 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 7 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/screencopy.rs:66— dll/src/desktop/shell2/linux/wayland/screencopy.rs:66-89 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:94-123 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:132-166 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:172-233 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:244-310 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:315-365 — 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) doc/src/codegen/v2/lang_ada/types.rs:561— doc/src/codegen/v2/lang_ada/types.rs:561-571 | doc/src/codegen/v2/lang_csharp/types.rs:799-809 | doc/src/codegen/v2/lang_java/types.rs:1047-1057 | doc/src/codegen/v2/lang_kotlin/mod.rs:1267-1277 | doc/src/codegen/v2/lang_ocaml/types.rs:963-973 | doc/src/codegen/v2/lang_smalltalk/types.rs:410-420 — 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) webrender/core/src/device/gl.rs:3661— webrender/core/src/device/gl.rs:3661-3682 | webrender/core/src/device/gl.rs:3684-3705 | webrender/core/src/device/gl.rs:3707-3723 | webrender/core/src/device/gl.rs:3725-3741 | webrender/core/src/device/gl.rs:3743-3760 | webrender/core/src/device/gl.rs:3762-3784 — 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 (33 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:4218— dll/src/desktop/shell2/linux/x11/mod.rs:4218-4250 | dll/src/desktop/shell2/windows/mod.rs:7637-7669 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (33 lines × 2) doc/src/codegen/v2/lang_rust.rs:4873— doc/src/codegen/v2/lang_rust.rs:4873-4905 | doc/src/codegen/v2/lang_rust.rs:4928-4960 — both copies are in the same file, so extract the 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 (33 lines × 2) doc/src/autofix/debug.rs:1171— doc/src/autofix/debug.rs:1171-1203 | doc/src/autofix/debug.rs:1236-1268 — both copies are in the same file, so extract the 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 (30 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6240— dll/src/desktop/shell2/linux/x11/mod.rs:6240-6269 | dll/src/desktop/shell2/windows/mod.rs:1899-1928 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 2) doc/src/codegen/v2/lang_python.rs:1550— doc/src/codegen/v2/lang_python.rs:1550-1579 | doc/src/codegen/v2/lang_python.rs:1599-1628 — both copies are in the same file, so extract the 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 (30 lines × 2) doc/src/codegen/v2/lang_lisp/wrappers.rs:224— doc/src/codegen/v2/lang_lisp/wrappers.rs:224-253 | doc/src/codegen/v2/lang_lisp/wrappers.rs:281-310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–27 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4952— dll/src/desktop/shell2/linux/wayland/mod.rs:4952-4978 | dll/src/desktop/shell2/linux/x11/events.rs:898-919 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22–27 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:429— doc/src/codegen/v2/lang_node/wrappers.rs:429-455 | doc/src/codegen/v2/lang_node/wrappers.rs:653-674 — both copies are in the same file, so extract the 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 (22–27 lines × 2) layout/src/widgets/text_area.rs:655— layout/src/widgets/text_area.rs:655-676 | layout/src/widgets/text_input.rs:1028-1054 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23–25 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6904— dll/src/desktop/shell2/linux/x11/mod.rs:6904-6928 | dll/src/desktop/shell2/windows/mod.rs:1604-1626 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23–25 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:202— doc/src/codegen/v2/lang_php/wrappers.rs:202-226 | doc/src/codegen/v2/lang_php/wrappers.rs:390-412 — both copies are in the same file, so extract the 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 (23–25 lines × 2) layout/src/managers/gesture.rs:1958— layout/src/managers/gesture.rs:1958-1982 | layout/src/managers/gesture.rs:2036-2058 — both copies are in the same file, so extract the 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 (24–25 lines × 2) doc/src/codegen/v2/lang_d/model.rs:635— doc/src/codegen/v2/lang_d/model.rs:635-659 | doc/src/codegen/v2/lang_swift/model.rs:652-675 — `doc/src/codegen/v2/lang_d/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 20 separate duplicated blocks between them, totalling at least 209 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24–25 lines × 2) layout/src/text3/cache.rs:6321— layout/src/text3/cache.rs:6321-6345 | layout/src/text3/cache.rs:6412-6435 — both copies are in the same file, so extract the 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 (24–25 lines × 2) layout/src/widgets/pagination.rs:231— layout/src/widgets/pagination.rs:231-254 | layout/src/widgets/segmented.rs:200-224 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20–22 lines × 2) doc/src/codegen/v2/config.rs:481— doc/src/codegen/v2/config.rs:481-500 | doc/src/codegen/v2/config.rs:707-728 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–22 lines × 2) layout/src/solver3/getters.rs:4690— layout/src/solver3/getters.rs:4690-4711 | layout/src/solver3/getters.rs:5020-5039 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–22 lines × 2) layout/src/widgets/badge.rs:56— layout/src/widgets/badge.rs:56-75 | layout/src/widgets/chip.rs:135-156 — before extracting anything, compare `layout/src/widgets/badge.rs` and `layout/src/widgets/chip.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–21 lines × 3) doc/src/codegen/v2/lang_cpp/cpp17.rs:27— doc/src/codegen/v2/lang_cpp/cpp17.rs:27-47 | doc/src/codegen/v2/lang_cpp/cpp20.rs:37-57 | doc/src/codegen/v2/lang_cpp/cpp20.rs:434-448 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp17.rs` and `doc/src/codegen/v2/lang_cpp/cpp20.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 598 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–21 lines × 3) doc/src/codegen/v2/lang_java/wrappers.rs:1582— doc/src/codegen/v2/lang_java/wrappers.rs:1582-1602 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1617-1631 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1858-1872 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15–21 lines × 3) doc/src/codegen/v2/lang_ada/types.rs:133— doc/src/codegen/v2/lang_ada/types.rs:133-147 | doc/src/codegen/v2/lang_fortran/types.rs:95-110 | doc/src/codegen/v2/lang_pascal/types.rs:84-104 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_fortran/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 47 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19–21 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:11002— dll/src/desktop/shell2/linux/wayland/mod.rs:11002-11022 | dll/src/desktop/shell2/linux/x11/mod.rs:8756-8774 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (19–21 lines × 2) doc/src/patch/locatesource.rs:216— doc/src/patch/locatesource.rs:216-236 | doc/src/patch/locatesource.rs:398-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.
Duplicated block (19–21 lines × 2) layout/src/widgets/text_area.rs:681— layout/src/widgets/text_area.rs:681-699 | layout/src/widgets/text_input.rs:1059-1079 — before extracting anything, compare `layout/src/widgets/text_area.rs` and `layout/src/widgets/text_input.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 147 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:1453— dll/src/desktop/shell2/linux/wayland/mod.rs:1453-1470 | dll/src/desktop/shell2/windows/mod.rs:7007-7025 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 292 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:5923— dll/src/desktop/shell2/linux/x11/mod.rs:5923-5941 | dll/src/desktop/shell2/linux/x11/mod.rs:7383-7400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) dll/src/desktop/wr_translate2.rs:1537— dll/src/desktop/wr_translate2.rs:1537-1554 | dll/src/desktop/wr_translate2.rs:2920-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) dll/src/desktop/shell2/macos/mod.rs:7456— dll/src/desktop/shell2/macos/mod.rs:7456-7473 | dll/src/desktop/shell2/windows/mod.rs:7584-7600 — `dll/src/desktop/shell2/macos/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 12 separate duplicated blocks between them, totalling at least 186 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17–18 lines × 2) doc/src/reftest/autodoc.rs:1764— doc/src/reftest/autodoc.rs:1764-1781 | doc/src/reftest/autodoc.rs:2033-2049 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:144— doc/src/codegen/v2/lang_php/wrappers.rs:144-161 | doc/src/codegen/v2/lang_php/wrappers.rs:256-272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 3) dll/src/desktop/wr_translate2.rs:2405— dll/src/desktop/wr_translate2.rs:2405-2421 | dll/src/desktop/wr_translate2.rs:2540-2556 | dll/src/desktop/wr_translate2.rs:2650-2666 — 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 (17 lines × 3) doc/src/autofix/type_index.rs:255— doc/src/autofix/type_index.rs:255-271 | doc/src/autofix/type_index.rs:495-511 | doc/src/autofix/type_index.rs:531-547 — 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 (17 lines × 3) doc/src/autofix/debug.rs:723— doc/src/autofix/debug.rs:723-739 | doc/src/autofix/debug.rs:889-905 | doc/src/autofix/debug.rs:1020-1036 — 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 (14–16 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:6479— dll/src/desktop/shell2/linux/wayland/mod.rs:6479-6494 | dll/src/desktop/shell2/linux/x11/mod.rs:6207-6220 | dll/src/desktop/shell2/windows/mod.rs:1852-1865 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–16 lines × 3) webrender/core/src/batch.rs:1564— webrender/core/src/batch.rs:1564-1579 | webrender/core/src/batch.rs:2219-2232 | webrender/core/src/batch.rs:2262-2275 — 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 (14–16 lines × 3) webrender/core/src/device/gl.rs:3663— webrender/core/src/device/gl.rs:3663-3678 | webrender/core/src/device/gl.rs:3686-3701 | webrender/core/src/device/gl.rs:3745-3758 — 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 (13–16 lines × 2) dll/src/desktop/compositor2.rs:682— dll/src/desktop/compositor2.rs:682-694 | dll/src/desktop/compositor2.rs:1429-1444 — both copies are in the same file, so extract the 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–16 lines × 2) doc/src/codegen/v2/lang_cobol/types.rs:319— doc/src/codegen/v2/lang_cobol/types.rs:319-331 | doc/src/codegen/v2/lang_cobol/types.rs:357-372 — both copies are in the same file, so extract the 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–16 lines × 2) layout/src/solver3/display_list.rs:10919— layout/src/solver3/display_list.rs:10919-10931 | layout/src/solver3/display_list.rs:11166-11181 — both copies are in the same file, so extract the 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) doc/src/autofix/module_map.rs:480— doc/src/autofix/module_map.rs:480-495 | doc/src/autotest/mod.rs:260-269 — 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–16 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1445— doc/src/codegen/v2/lang_csharp/wrappers.rs:1445-1454 | doc/src/codegen/v2/lang_java/wrappers.rs:1353-1368 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–16 lines × 2) layout/src/text3/cache.rs:13224— layout/src/text3/cache.rs:13224-13233 | layout/src/text3/cache.rs:13364-13379 — both copies are in the same file, so extract the 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–15 lines × 2) dll/src/desktop/shell2/headless/mod.rs:1777— dll/src/desktop/shell2/headless/mod.rs:1777-1791 | dll/src/desktop/shell2/headless/mod.rs:1926-1936 — both copies are in the same file, so extract the 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–15 lines × 2) doc/src/reftest/autodoc.rs:1571— doc/src/reftest/autodoc.rs:1571-1581 | doc/src/reftest/pipeline.rs:278-292 — 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–15 lines × 2) layout/src/widgets/text_input.rs:1027— layout/src/widgets/text_input.rs:1027-1041 | layout/src/widgets/text_input.rs:1058-1068 — both copies are in the same file, so extract the 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–15 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10471— dll/src/desktop/shell2/linux/wayland/mod.rs:10471-10485 | dll/src/desktop/shell2/linux/wayland/mod.rs:10611-10623 — both copies are in the same file, so extract the 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–15 lines × 2) doc/src/codegen/v2/lang_freebasic/functions.rs:117— doc/src/codegen/v2/lang_freebasic/functions.rs:117-131 | doc/src/codegen/v2/lang_freebasic/types.rs:362-374 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–15 lines × 2) layout/src/dom_lint.rs:885— layout/src/dom_lint.rs:885-899 | layout/src/dom_lint.rs:1092-1104 — both copies are in the same file, so extract the 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–14 lines × 2) dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:281— dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:281-291 | dll/src/desktop/shell2/linux/gnome_menu/protocol_impl.rs:478-491 — both copies are in the same file, so extract the 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–14 lines × 2) dll/src/desktop/shell2/macos/mod.rs:909— dll/src/desktop/shell2/macos/mod.rs:909-922 | dll/src/desktop/shell2/macos/mod.rs:950-960 — both copies are in the same file, so extract the 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–14 lines × 2) doc/src/codegen/v2/lang_rust.rs:2892— doc/src/codegen/v2/lang_rust.rs:2892-2902 | doc/src/codegen/v2/lang_rust.rs:3176-3189 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/extra/file_picker/ios.rs:286— dll/src/desktop/extra/file_picker/ios.rs:286-295 | dll/src/desktop/shell2/ios/mod.rs:2577-2589 — 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–13 lines × 2) doc/src/codegen/v2/lang_perl/types.rs:130— doc/src/codegen/v2/lang_perl/types.rs:130-142 | doc/src/codegen/v2/lang_ruby/types.rs:183-192 — `doc/src/codegen/v2/lang_perl/types.rs` and `doc/src/codegen/v2/lang_ruby/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 49 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10–13 lines × 2) layout/src/managers/gpu_state.rs:270— layout/src/managers/gpu_state.rs:270-282 | layout/src/window.rs:11900-11909 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–12 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:4486— dll/src/desktop/shell2/linux/wayland/mod.rs:4486-4497 | dll/src/desktop/shell2/linux/x11/events.rs:576-583 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–12 lines × 2) doc/src/codegen/v2/lang_haskell/cshim.rs:260— doc/src/codegen/v2/lang_haskell/cshim.rs:260-271 | doc/src/codegen/v2/lang_haskell/cshim.rs:522-529 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–12 lines × 2) doc/src/codegen/v2/lang_cpp/common.rs:540— doc/src/codegen/v2/lang_cpp/common.rs:540-551 | doc/src/codegen/v2/lang_cpp/common.rs:959-966 — both copies are in the same file, so extract the 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–10 lines × 2) doc/src/api.rs:2011— doc/src/api.rs:2011-2020 | doc/src/api.rs:2283-2289 — both copies are in the same file, so extract the 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–10 lines × 2) doc/src/reftest/autoreview.rs:1122— doc/src/reftest/autoreview.rs:1122-1128 | doc/src/reftest/autoreview.rs:1558-1567 — both copies are in the same file, so extract the 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–10 lines × 2) doc/src/codegen/v2/transmute_helpers.rs:406— doc/src/codegen/v2/transmute_helpers.rs:406-415 | doc/src/codegen/v2/transmute_helpers.rs:428-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 5) dll/src/desktop/shell2/common/event.rs:6581— dll/src/desktop/shell2/common/event.rs:6581-6587 | dll/src/desktop/shell2/common/event.rs:11164-11170 | dll/src/desktop/shell2/common/event.rs:11842-11849 | dll/src/desktop/shell2/common/event.rs:11935-11942 | dll/src/desktop/shell2/common/event.rs:12146-12152 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) doc/src/main.rs:1636— doc/src/main.rs:1636-1642 | doc/src/main.rs:1647-1653 | doc/src/main.rs:1674-1680 | doc/src/main.rs:1685-1691 | doc/src/main.rs:1696-1702 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) webrender/core/src/prim_store/picture.rs:785— webrender/core/src/prim_store/picture.rs:785-791 | webrender/core/src/prim_store/picture.rs:812-818 | webrender/core/src/prim_store/picture.rs:901-907 | webrender/core/src/prim_store/picture.rs:920-926 | webrender/core/src/prim_store/picture.rs:949-955 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) doc/src/codegen/v2/lang_crystal/mod.rs:290— doc/src/codegen/v2/lang_crystal/mod.rs:290-294 | doc/src/codegen/v2/lang_d/mod.rs:418-422 | doc/src/codegen/v2/lang_julia/mod.rs:184-188 | doc/src/codegen/v2/lang_odin/mod.rs:119-123 | doc/src/codegen/v2/lang_v/mod.rs:142-146 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_d/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 5) doc/src/codegen/v2/lang_cpp/cpp03.rs:615— doc/src/codegen/v2/lang_cpp/cpp03.rs:615-619 | doc/src/codegen/v2/lang_cpp/cpp11.rs:537-541 | doc/src/codegen/v2/lang_cpp/cpp17.rs:729-733 | doc/src/codegen/v2/lang_cpp/cpp20.rs:845-849 | doc/src/codegen/v2/lang_cpp/cpp20.rs:912-916 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 5) doc/src/codegen/v2/lang_crystal/types.rs:328— doc/src/codegen/v2/lang_crystal/types.rs:328-333 | doc/src/codegen/v2/lang_d/types.rs:213-217 | doc/src/codegen/v2/lang_julia/types.rs:315-320 | doc/src/codegen/v2/lang_odin/types.rs:274-279 | doc/src/codegen/v2/lang_v/types.rs:282-287 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Off the main sequence: webrender_build — webrender_build: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: azul-css — azul-css: abstractness 0.02, instability 0.00, distance 0.98 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: azul-core — azul-core: abstractness 0.02, instability 0.14, distance 0.84 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Duplicated block (8 lines × 2 locations) REDACTED:1442— REDACTED:1442 · REDACTED:1463 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) REDACTED:2915— REDACTED:2915 · REDACTED:2964 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (8 lines × 2 locations) REDACTED:3352— REDACTED:3352 · REDACTED:3389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
RenderTask::new_svg_filter_graph (cyclomatic 134) webrender/core/src/render_task.rs:1643— RenderTask::new_svg_filter_graph has cyclomatic complexity 134 (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.
RenderTask::new_svg_filter (cyclomatic 17) webrender/core/src/render_task.rs:1297— RenderTask::new_svg_filter has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: RenderTaskKind::as_str (cyclomatic 22) 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.
PicturePrimitive::take_context (cyclomatic 84) webrender/core/src/picture.rs:5302— PicturePrimitive::take_context has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PicturePrimitive::prepare_for_render (cyclomatic 19) webrender/core/src/picture.rs:7265— PicturePrimitive::prepare_for_render has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: PictureCompositeMode::kind (cyclomatic 24) 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.
A11yManager::build_node (cyclomatic 62) layout/src/managers/a11y.rs:851— A11yManager::build_node has cyclomatic complexity 62 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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.
A11yManager::update_tree (cyclomatic 34) layout/src/managers/a11y.rs:470— A11yManager::update_tree 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. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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.
Device::new (cyclomatic 55) webrender/core/src/device/gl.rs:1440— Device::new has cyclomatic complexity 55 (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.
Device::link_program (cyclomatic 18) webrender/core/src/device/gl.rs:2444— Device::link_program 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.
LayoutTreeBuilder::process_node (cyclomatic 41) layout/src/solver3/layout_tree.rs:2062— LayoutTreeBuilder::process_node has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LayoutTreeBuilder::apply_split_previews (cyclomatic 16) layout/src/solver3/layout_tree.rs:2976— LayoutTreeBuilder::apply_split_previews 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: azul_layout::solver3::layout_tree::determine_formatting_context_for_display (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 function is counted neither in this dimension's figures nor in its score.
UnifiedLayout::get_selection_rects (cyclomatic 36) layout/src/text3/cache.rs:5767— UnifiedLayout::get_selection_rects 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.
UnifiedLayout::move_cursor_to_prev_word (cyclomatic 16) layout/src/text3/cache.rs:6604— UnifiedLayout::move_cursor_to_prev_word 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.
CssPropertyWithConditionsVec::parse_at_rule (cyclomatic 34) css/src/dynamic_selector.rs:2260— CssPropertyWithConditionsVec::parse_at_rule 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.
CssPropertyWithConditionsVec::parse_media_query (cyclomatic 16) css/src/dynamic_selector.rs:2419— CssPropertyWithConditionsVec::parse_media_query 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: azul_css::dynamic_selector::parse_android_version (cyclomatic 24) 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.
IntrinsicSizeCalculator::calculate_node_intrinsic_sizes (cyclomatic 29) layout/src/solver3/sizing.rs:512— IntrinsicSizeCalculator::calculate_node_intrinsic_sizes 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.
IntrinsicSizeCalculator::calculate_intrinsic_recursive (cyclomatic 25) layout/src/solver3/sizing.rs:279— IntrinsicSizeCalculator::calculate_intrinsic_recursive 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.
SvgNodeData::eq (cyclomatic 25) core/src/dom.rs:1946— SvgNodeData::eq 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. This is NOT this file's highest cyclomatic complexity: NodeType::to_library_owned_nodetype (cyclomatic 184) 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.
SvgNodeData::hash (cyclomatic 17) core/src/dom.rs:2143— SvgNodeData::hash has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: NodeType::to_library_owned_nodetype (cyclomatic 184) 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.
Shaders::new (cyclomatic 22) webrender/core/src/renderer/shade.rs:630— Shaders::new 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.
Shaders::get (cyclomatic 21) webrender/core/src/renderer/shade.rs:1182— Shaders::get 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.
SpatialNode::calculate_sticky_offset (cyclomatic 21) webrender/core/src/spatial_node.rs:607— SpatialNode::calculate_sticky_offset 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.
SpatialNode::update_transform (cyclomatic 19) webrender/core/src/spatial_node.rs:370— SpatialNode::update_transform 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.
SymbolCollector::visit_item_fn (cyclomatic 20) doc/src/patch/parser.rs:279— SymbolCollector::visit_item_fn 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.
SymbolCollector::visit_impl_item_fn (cyclomatic 19) doc/src/patch/parser.rs:401— SymbolCollector::visit_impl_item_fn 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.
CGenerator::generate_types (cyclomatic 18) doc/src/codegen/v2/lang_c.rs:203— CGenerator::generate_types 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: CGenerator::rust_type_to_c (cyclomatic 31) 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.
CGenerator::generate_function_declaration (cyclomatic 18) doc/src/codegen/v2/lang_c.rs:869— CGenerator::generate_function_declaration has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: CGenerator::rust_type_to_c (cyclomatic 31) 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.
A11yManager::update_tree (cognitive 104) layout/src/managers/a11y.rs:470— A11yManager::update_tree has cognitive complexity 104 (threshold 15). Drivers by points: if/else 26 (82 pts), loops 6 (12 pts), match/switch 2 (7 pts), boolean chains 3 (nesting depth added 67). 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.
A11yManager::build_node (cognitive 54) layout/src/managers/a11y.rs:851— A11yManager::build_node has cognitive complexity 54 (threshold 15). Drivers by points: if/else 23 (33 pts), match/switch 6 (13 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileNode::maybe_merge_or_split (cognitive 57) webrender/core/src/picture.rs:7714— TileNode::maybe_merge_or_split has cognitive complexity 57 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 5 (13 pts), match/switch 5 (10 pts), boolean chains 1 (nesting depth added 34). Of this number, 55 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TileNode::update_dirty_rects (cognitive 21) webrender/core/src/picture.rs:7886— TileNode::update_dirty_rects has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ParsedFont::from_provider (cognitive 54) layout/src/font.rs:1011— ParsedFont::from_provider has cognitive complexity 54 (threshold 15). Drivers by points: if/else 26 (42 pts), loops 2 (6 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 21). Of this number, 48 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsedFont::decode_glyph_inner (cognitive 48) layout/src/font.rs:1792— ParsedFont::decode_glyph_inner has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (48 pts) (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.
Cpp17Generator::generate_method_implementations (cognitive 48) doc/src/codegen/v2/lang_cpp/cpp17.rs:277— Cpp17Generator::generate_method_implementations has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (39 pts), boolean chains 6, loops 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.
Cpp17Generator::generate_method_declarations (cognitive 17) doc/src/codegen/v2/lang_cpp/cpp17.rs:804— Cpp17Generator::generate_method_declarations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, loops 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.
SpatialNode::update_transform (cognitive 45) webrender/core/src/spatial_node.rs:370— SpatialNode::update_transform has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 6 (14 pts), loops 1 (3 pts), boolean chains 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.
SpatialNode::calculate_sticky_offset (cognitive 28) webrender/core/src/spatial_node.rs:607— SpatialNode::calculate_sticky_offset has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 5 (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.
Shaders::new (cognitive 34) webrender/core/src/renderer/shade.rs:630— Shaders::new has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 6, boolean chains 5 (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.
Shaders::get (cognitive 25) webrender/core/src/renderer/shade.rs:1182— Shaders::get has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MultiCursorState::move_all_cursors_with (cognitive 31) core/src/selection.rs:893— MultiCursorState::move_all_cursors_with has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiCursorState::merge_overlapping (cognitive 23) core/src/selection.rs:734— MultiCursorState::merge_overlapping has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, 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.
LayoutTree::memory_report (cognitive 31) layout/src/solver3/layout_tree.rs:1418— LayoutTree::memory_report has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (9 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.
LayoutTree::get_ifc_root_layout_index (cognitive 17) layout/src/solver3/layout_tree.rs:1842— LayoutTree::get_ifc_root_layout_index has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 1 (4 pts), loops 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlyphCache::get_or_build_cells (cognitive 27) layout/src/glyph_cache.rs:331— GlyphCache::get_or_build_cells has cognitive complexity 27 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 3 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
GlyphCache::get_or_build_cells_lcd (cognitive 19) layout/src/glyph_cache.rs:496— GlyphCache::get_or_build_cells_lcd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (18 pts), 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.
SmartCtor::build (cognitive 25) doc/src/codegen/v2/lang_ocaml/wrappers.rs:885— SmartCtor::build has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (3 pts), boolean chains 2, match/switch 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmartCtor::emit_implementation (cognitive 19) doc/src/codegen/v2/lang_ocaml/wrappers.rs:1013— SmartCtor::emit_implementation has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 5 (7 pts), loops 4 (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.
GpuCacheTexture::update (cognitive 23) webrender/core/src/renderer/gpu_cache.rs:269— GpuCacheTexture::update has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (16 pts), match/switch 3 (7 pts) (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.
GpuCacheTexture::ensure_texture (cognitive 20) webrender/core/src/renderer/gpu_cache.rs:98— GpuCacheTexture::ensure_texture has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 1 (4 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 7). 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.
FontManager::register_variable_instances (cognitive 19) layout/src/text3/cache.rs:1562— FontManager::register_variable_instances has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 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.
FontManager::register_named_font_in_tier (cognitive 17) layout/src/text3/cache.rs:1425— FontManager::register_named_font_in_tier has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 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.
TooManyFunctions: azul_layout::widgets::capture_common layout/src/widgets/capture_common.rs:63— TooManyFunctions — 40 free functions. The bar is 30 free functions; this is 10 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: azul_layout::text3::script layout/src/text3/script.rs:133— TooManyFunctions — 33 free functions. The bar is 30 free functions; this is 3 over it, 1.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.
Change coupling: prop_cache.rs ↔ macros.rs core/src/prop_cache.rs— `core/src/prop_cache.rs` and `css/src/props/macros.rs` change together 58% of the time (22 of the 38 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 22 shared commits counted here, the most recent 3 are `87739d23` feat(css): 9a-i-b - spatial-navigation-contain and spatial-navigation…; `3f9de5fc` feat(css): wire overscroll-behavior end to end, so overscroll can be …; `d51fa6e8` feat(css): -azul-app-region, the real property, and native window grabs — run `git show` on any of them.
Change coupling: tabs.rs ↔ text_input.rs layout/src/widgets/tabs.rs— `layout/src/widgets/tabs.rs` and `layout/src/widgets/text_input.rs` 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) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `3964e334` fix(widgets): flex properties do nothing without `display: flex`; `a81aa6cc` ffi: roll impl_managed_callback! to 16 widget callbacks + internals doc; `294043c8` refactor(dropdown): rewrite with clean CSS + builder API, system:ui f… — run `git show` on any of them.
Near-duplicate member pair (67 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:2971— dll/src/desktop/shell2/linux/wayland/mod.rs:2971-3294 | dll/src/desktop/shell2/linux/x11/mod.rs:4486-4758 — These two members are variants of one another: 67 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 (67 shared lines) layout/src/widgets/themes/flat.rs:1469— layout/src/widgets/themes/flat.rs:1469-1588 | layout/src/widgets/themes/flora.rs:1876-2007 — These two members are variants of one another: 67 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 (58 shared lines) doc/src/reftest/autoreview.rs:1441— doc/src/reftest/autoreview.rs:1441-1534 | doc/src/reftest/autoreview.rs:1970-2114 — These two members are variants of one another: 58 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 (58 shared lines) doc/src/codegen/v2/lang_php/wrappers.rs:109— doc/src/codegen/v2/lang_php/wrappers.rs:109-226 | doc/src/codegen/v2/lang_php/wrappers.rs:232-412 — These two members are variants of one another: 58 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 (45 shared lines) doc/src/codegen/v2/lang_java/wrappers.rs:1737— doc/src/codegen/v2/lang_java/wrappers.rs:1737-1827 | doc/src/codegen/v2/lang_java/wrappers.rs:1869-1926 — These two members are variants of one another: 45 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 (45 shared lines) layout/src/widgets/text_area.rs:712— layout/src/widgets/text_area.rs:712-819 | layout/src/widgets/text_input.rs:1092-1216 — These two members are variants of one another: 45 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 (40 shared lines) dll/src/desktop/shell2/android/mod.rs:2675— dll/src/desktop/shell2/android/mod.rs:2675-2824 | dll/src/desktop/shell2/android/mod.rs:2975-3091 — These two members are variants of one another: 40 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 (40 shared lines) doc/src/codegen/v2/lang_cpp/common.rs:517— doc/src/codegen/v2/lang_cpp/common.rs:517-570 | doc/src/codegen/v2/lang_cpp/common.rs:929-988 — These two members are variants of one another: 40 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 (35 corresponding lines) · ×2
Edited copy of a member (35 corresponding lines) layout/src/xml/svg.rs:149— layout/src/xml/svg.rs:149-189 | layout/src/xml/svg.rs:192-273 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) dll/src/desktop/shell2/macos/mod.rs:4242— dll/src/desktop/shell2/macos/mod.rs:4242-4307 | dll/src/desktop/shell2/macos/mod.rs:4327-4386 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×2
Edited copy of a member (17 corresponding lines) dll/src/desktop/shell2/macos/mod.rs:2656— dll/src/desktop/shell2/macos/mod.rs:2656-2756 | dll/src/desktop/shell2/macos/mod.rs:2802-2825 — 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.
Edited copy of a member (17 corresponding lines) layout/src/cpurender/compositor.rs:1667— layout/src/cpurender/compositor.rs:1667-1684 | layout/src/cpurender/compositor.rs:1737-1765 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×2
Edited copy of a member (15 corresponding lines) layout/src/widgets/themes/flora.rs:789— layout/src/widgets/themes/flora.rs:789-957 | layout/src/widgets/themes/flora.rs:1037-1185 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (15 corresponding lines) layout/src/widgets/themes/flora.rs:789— layout/src/widgets/themes/flora.rs:789-957 | layout/src/widgets/themes/flora.rs:1876-2007 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (11 members, 50+ identical tokens) dll/src/desktop/shell2/macos/mod.rs:265— dll/src/desktop/shell2/macos/mod.rs:265-323 | dll/src/desktop/shell2/macos/mod.rs:325-369 | dll/src/desktop/shell2/macos/mod.rs:371-398 | dll/src/desktop/shell2/macos/mod.rs:400-428 | dll/src/desktop/shell2/macos/mod.rs:657-695 | dll/src/desktop/shell2/macos/mod.rs:697-725 | dll/src/desktop/shell2/macos/mod.rs:727-755 | dll/src/desktop/shell2/macos/mod.rs:757-784 | dll/src/desktop/shell2/macos/mod.rs:786-813 | dll/src/desktop/shell2/macos/mod.rs:815-842 | dll/src/desktop/shell2/macos/mod.rs:879-899 — These 11 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 11 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 11 times.
Members sharing a duplicated core (11 members, 50+ identical tokens) doc/src/codegen/v2/lang_ada/mod.rs:188— doc/src/codegen/v2/lang_ada/mod.rs:188-235 | doc/src/codegen/v2/lang_algol68/mod.rs:345-394 | doc/src/codegen/v2/lang_cobol/types.rs:501-573 | doc/src/codegen/v2/lang_freebasic/mod.rs:117-186 | doc/src/codegen/v2/lang_haskell/types.rs:1082-1129 | doc/src/codegen/v2/lang_nim/mod.rs:146-213 | doc/src/codegen/v2/lang_nim/mod.rs:217-235 | doc/src/codegen/v2/lang_ocaml/mod.rs:891-945 | doc/src/codegen/v2/lang_pascal/mod.rs:228-307 | doc/src/codegen/v2/lang_smalltalk/mod.rs:148-198 | doc/src/codegen/v2/lang_vb6/mod.rs:197-262 — These 11 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 11 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 11 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (10 members, 50+ identical tokens) doc/src/codegen/v2/lang_csharp/mod.rs:286— doc/src/codegen/v2/lang_csharp/mod.rs:286-300 | doc/src/codegen/v2/lang_freebasic/mod.rs:328-342 | doc/src/codegen/v2/lang_go/mod.rs:410-424 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2362-2376 | doc/src/codegen/v2/lang_nim/mod.rs:376-390 | doc/src/codegen/v2/lang_ocaml/mod.rs:1022-1036 | doc/src/codegen/v2/lang_pascal/mod.rs:506-520 | doc/src/codegen/v2/lang_powershell/cmdlets.rs:369-386 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:435-449 | doc/src/codegen/v2/lang_vb6/mod.rs:393-407 — 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.
Members sharing a duplicated core (10 members, 50+ identical tokens) layout/src/callbacks.rs:3459— layout/src/callbacks.rs:3459-3480 | layout/src/callbacks.rs:3484-3505 | layout/src/callbacks.rs:3509-3530 | layout/src/callbacks.rs:3534-3555 | layout/src/callbacks.rs:3559-3580 | layout/src/callbacks.rs:3585-3592 | layout/src/callbacks.rs:3636-3648 | layout/src/callbacks.rs:3655-3664 | layout/src/callbacks.rs:3680-3759 | layout/src/callbacks.rs:3787-3800 — 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.
Duplicated block (48 lines × 2) layout/src/widgets/badge.rs:77— layout/src/widgets/badge.rs:77-124 | layout/src/widgets/chip.rs:158-205 — before extracting anything, compare `layout/src/widgets/badge.rs` and `layout/src/widgets/chip.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (48 lines × 2) layout/src/widgets/themes/flat.rs:778— layout/src/widgets/themes/flat.rs:778-825 | layout/src/widgets/themes/flora.rs:1038-1085 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (40 lines × 2) layout/src/widgets/themes/flat.rs:1038— layout/src/widgets/themes/flat.rs:1038-1077 | layout/src/widgets/themes/flora.rs:1310-1349 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (40 lines × 2) layout/src/widgets/themes/flat.rs:2120— layout/src/widgets/themes/flat.rs:2120-2159 | layout/src/widgets/themes/flora.rs:2434-2473 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (37 lines × 2) doc/src/codegen/v2/rust/dynamic_binding.rs:42— doc/src/codegen/v2/rust/dynamic_binding.rs:42-78 | doc/src/codegen/v2/rust/static_binding.rs:108-144 — before extracting anything, compare `doc/src/codegen/v2/rust/dynamic_binding.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 66 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (37 lines × 2) layout/src/solver3/fc.rs:8969— layout/src/solver3/fc.rs:8969-9005 | layout/src/solver3/fc.rs:9530-9566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–35 lines × 2) doc/src/reftest/autoreview.rs:1467— doc/src/reftest/autoreview.rs:1467-1501 | doc/src/reftest/autoreview.rs:1996-2026 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–35 lines × 2) layout/src/widgets/node_graph.rs:873— layout/src/widgets/node_graph.rs:873-907 | layout/src/widgets/node_graph.rs:966-996 — both copies are in the same file, so extract the 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 (30–33 lines × 2) doc/src/api.rs:2022— doc/src/api.rs:2022-2054 | doc/src/api.rs:2295-2324 — both copies are in the same file, so extract the 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 (30–33 lines × 2) layout/src/widgets/camera.rs:453— layout/src/widgets/camera.rs:453-485 | layout/src/widgets/screencap.rs:402-431 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30–31 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10884— dll/src/desktop/shell2/linux/wayland/mod.rs:10884-10914 | dll/src/desktop/shell2/linux/x11/mod.rs:8642-8671 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (30–31 lines × 2) dll/src/desktop/extra/permission/ios.rs:100— dll/src/desktop/extra/permission/ios.rs:100-130 | dll/src/desktop/extra/permission/macos.rs:200-229 — before extracting anything, compare `dll/src/desktop/extra/permission/ios.rs` and `dll/src/desktop/extra/permission/macos.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (29 lines × 2) layout/src/window.rs:13293— layout/src/window.rs:13293-13321 | layout/src/window.rs:13326-13354 — both copies are in the same file, so extract the 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 (29 lines × 2) layout/src/widgets/themes/flat.rs:1719— layout/src/widgets/themes/flat.rs:1719-1747 | layout/src/widgets/themes/flora.rs:2137-2165 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 4) webrender/core/src/batch.rs:2839— webrender/core/src/batch.rs:2839-2863 | webrender/core/src/batch.rs:2964-2988 | webrender/core/src/batch.rs:3091-3115 | webrender/core/src/batch.rs:3218-3242 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25 lines × 4) webrender/core/src/picture.rs:6409— webrender/core/src/picture.rs:6409-6433 | webrender/core/src/picture.rs:6439-6463 | webrender/core/src/picture.rs:6469-6493 | webrender/core/src/picture.rs:6505-6529 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22–24 lines × 2) dll/src/desktop/shell2/android/mod.rs:414— dll/src/desktop/shell2/android/mod.rs:414-437 | dll/src/desktop/shell2/ios/mod.rs:1813-1834 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (22–24 lines × 2) layout/src/cpurender/raster.rs:3274— layout/src/cpurender/raster.rs:3274-3297 | layout/src/cpurender/raster.rs:3301-3322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–24 lines × 2) dll/src/web/transpiler_remill.rs:1287— dll/src/web/transpiler_remill.rs:1287-1310 | dll/src/web/transpiler_remill.rs:6694-6710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–24 lines × 2) dll/src/desktop/compositor2.rs:452— dll/src/desktop/compositor2.rs:452-468 | dll/src/desktop/compositor2.rs:529-552 — both copies are in the same file, so extract the 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 (23–24 lines × 2) doc/src/autofix/diff.rs:812— doc/src/autofix/diff.rs:812-835 | doc/src/autofix/diff.rs:843-865 — both copies are in the same file, so extract the 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 (23–24 lines × 2) doc/src/codegen/v2/lang_d/wrappers.rs:1641— doc/src/codegen/v2/lang_d/wrappers.rs:1641-1663 | doc/src/codegen/v2/lang_swift/wrappers.rs:1553-1576 — `doc/src/codegen/v2/lang_d/wrappers.rs` and `doc/src/codegen/v2/lang_swift/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 29 separate duplicated blocks between them, totalling at least 269 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21–23 lines × 3) dll/src/desktop/shell2/linux/x11/mod.rs:6237— dll/src/desktop/shell2/linux/x11/mod.rs:6237-6258 | dll/src/desktop/shell2/windows/mod.rs:1896-1918 | dll/src/desktop/shell2/windows/mod.rs:1963-1983 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21–23 lines × 3) layout/src/solver3/fc.rs:1699— layout/src/solver3/fc.rs:1699-1720 | layout/src/solver3/fc.rs:2444-2466 | layout/src/solver3/fc.rs:2530-2550 — 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 (21–23 lines × 2) dll/src/desktop/shell2/common/event.rs:933— dll/src/desktop/shell2/common/event.rs:933-953 | dll/src/desktop/shell2/common/event.rs:985-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–23 lines × 2) doc/src/codegen/v2/lang_haskell/types.rs:467— doc/src/codegen/v2/lang_haskell/types.rs:467-489 | doc/src/codegen/v2/lang_ruby/wrappers.rs:631-651 — 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 (21–22 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:11024— dll/src/desktop/shell2/linux/wayland/mod.rs:11024-11045 | dll/src/desktop/shell2/linux/x11/mod.rs:8776-8796 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21–22 lines × 2) dll/src/desktop/shell2/linux/x11/accessibility.rs:171— dll/src/desktop/shell2/linux/x11/accessibility.rs:171-192 | dll/src/desktop/shell2/windows/accessibility.rs:148-168 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/accessibility.rs` and `dll/src/desktop/shell2/windows/accessibility.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 5) layout/src/widgets/backstage.rs:256— layout/src/widgets/backstage.rs:256-276 | layout/src/widgets/quick_access.rs:301-321 | layout/src/widgets/ribbon.rs:598-618 | layout/src/widgets/statusbar.rs:324-344 | layout/src/widgets/statusbar.rs:564-584 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/quick_access.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 5) webrender/core/src/picture.rs:6406— webrender/core/src/picture.rs:6406-6426 | webrender/core/src/picture.rs:6436-6456 | webrender/core/src/picture.rs:6466-6486 | webrender/core/src/picture.rs:6502-6522 | webrender/core/src/picture.rs:6532-6552 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21 lines × 4) doc/src/reftest/autodoc.rs:1116— doc/src/reftest/autodoc.rs:1116-1136 | doc/src/reftest/autoreview.rs:756-776 | doc/src/reftest/autoreview.rs:992-1012 | doc/src/reftest/autoreview.rs:1895-1915 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 4) webrender/core/src/batch.rs:2871— webrender/core/src/batch.rs:2871-2891 | webrender/core/src/batch.rs:2998-3018 | webrender/core/src/batch.rs:3125-3145 | webrender/core/src/batch.rs:3252-3272 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–21 lines × 2) doc/src/codegen/v2/lang_cpp/cpp11.rs:29— doc/src/codegen/v2/lang_cpp/cpp11.rs:29-49 | doc/src/codegen/v2/lang_cpp/cpp14.rs:24-37 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–21 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:786— doc/src/codegen/v2/lang_csharp/wrappers.rs:786-806 | doc/src/codegen/v2/lang_csharp/wrappers.rs:927-940 — both copies are in the same file, so extract the 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–20 lines × 2) doc/src/codegen/v2/lang_rust.rs:3522— doc/src/codegen/v2/lang_rust.rs:3522-3534 | doc/src/codegen/v2/lang_rust.rs:3719-3738 — both copies are in the same file, so extract the 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–20 lines × 2) layout/src/form.rs:77— layout/src/form.rs:77-96 | layout/src/form.rs:313-325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–19 lines × 2) css/src/system.rs:2762— css/src/system.rs:2762-2780 | css/src/system.rs:2837-2853 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–19 lines × 2) webrender/core/src/picture.rs:4748— webrender/core/src/picture.rs:4748-4764 | webrender/core/src/render_task.rs:2265-2283 — 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 × 3) doc/src/autofix/type_index.rs:2976— doc/src/autofix/type_index.rs:2976-2993 | doc/src/autofix/type_index.rs:3002-3019 | doc/src/autofix/type_index.rs:3031-3048 — 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 (18 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:542— doc/src/codegen/v2/lang_csharp/wrappers.rs:542-559 | doc/src/codegen/v2/lang_java/wrappers.rs:958-975 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:371-388 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:10938— dll/src/desktop/shell2/linux/wayland/mod.rs:10938-10954 | dll/src/desktop/shell2/linux/wayland/mod.rs:11057-11073 | dll/src/desktop/shell2/linux/x11/mod.rs:8695-8711 | dll/src/desktop/shell2/linux/x11/mod.rs:8808-8824 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:192— doc/src/codegen/v2/lang_cpp/cpp03.rs:192-208 | doc/src/codegen/v2/lang_cpp/cpp11.rs:702-718 | doc/src/codegen/v2/lang_cpp/cpp17.rs:213-229 | doc/src/codegen/v2/lang_cpp/cpp20.rs:678-694 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–17 lines × 2) css/src/dynamic_selector.rs:2354— css/src/dynamic_selector.rs:2354-2364 | css/src/dynamic_selector.rs:2425-2441 — both copies are in the same file, so extract the 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–17 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:561— doc/src/codegen/v2/lang_node/wrappers.rs:561-577 | doc/src/codegen/v2/lang_node/wrappers.rs:741-751 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) dll/src/desktop/shell2/common/event.rs:12904— dll/src/desktop/shell2/common/event.rs:12904-12920 | dll/src/desktop/shell2/common/event.rs:13086-13099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) layout/src/cpurender/raster.rs:3515— layout/src/cpurender/raster.rs:3515-3528 | layout/src/cpurender/raster.rs:3792-3808 — both copies are in the same file, so extract the 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–17 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3882— dll/src/desktop/shell2/linux/wayland/mod.rs:3882-3894 | dll/src/desktop/shell2/linux/x11/mod.rs:2119-2135 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–17 lines × 2) doc/src/codegen/v2/lang_rust.rs:2557— doc/src/codegen/v2/lang_rust.rs:2557-2573 | doc/src/codegen/v2/rust/shared.rs:149-161 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:629— doc/src/codegen/v2/lang_cpp/cpp03.rs:629-644 | doc/src/codegen/v2/lang_cpp/cpp11.rs:551-566 | doc/src/codegen/v2/lang_cpp/cpp17.rs:743-758 | doc/src/codegen/v2/lang_cpp/cpp20.rs:858-873 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) dll/src/desktop/display.rs:1120— dll/src/desktop/display.rs:1120-1135 | dll/src/desktop/display.rs:1192-1207 | dll/src/desktop/display.rs:1278-1293 | dll/src/desktop/display.rs:1404-1419 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:5016— dll/src/desktop/shell2/linux/wayland/mod.rs:5016-5030 | dll/src/desktop/shell2/linux/x11/events.rs:954-968 | dll/src/desktop/shell2/macos/events.rs:654-671 | dll/src/desktop/shell2/windows/mod.rs:5612-5627 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 4) doc/src/autofix/debug.rs:1179— doc/src/autofix/debug.rs:1179-1193 | doc/src/autofix/debug.rs:1208-1222 | doc/src/autofix/debug.rs:1244-1258 | doc/src/autofix/debug.rs:1273-1287 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–15 lines × 3) core/src/xml.rs:8395— core/src/xml.rs:8395-8409 | core/src/xml.rs:8481-8494 | core/src/xml.rs:8686-8699 — 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 (14–15 lines × 3) doc/src/reftest/autoreview.rs:1104— doc/src/reftest/autoreview.rs:1104-1117 | doc/src/reftest/autoreview.rs:1540-1553 | doc/src/reftest/autoreview.rs:2044-2058 — 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 (9–13 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:7689— dll/src/desktop/shell2/linux/wayland/mod.rs:7689-7697 | dll/src/desktop/shell2/linux/wayland/mod.rs:7924-7936 — both copies are in the same file, so extract the 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–13 lines × 2) dll/src/desktop/shell2/linux/x11/events.rs:1542— dll/src/desktop/shell2/linux/x11/events.rs:1542-1550 | dll/src/desktop/shell2/linux/x11/mod.rs:8029-8041 — 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 (4–13 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:122— doc/src/codegen/v2/lang_csharp/wrappers.rs:122-134 | doc/src/codegen/v2/lang_java/wrappers.rs:1281-1284 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:119-131 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (4–13 lines × 3) layout/src/solver3/display_list.rs:7770— layout/src/solver3/display_list.rs:7770-7782 | layout/src/solver3/display_list.rs:8006-8009 | layout/src/solver3/display_list.rs:8072-8084 — 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 (9–12 lines × 2) core/src/styled_dom.rs:1192— core/src/styled_dom.rs:1192-1200 | core/src/styled_dom.rs:1523-1534 — both copies are in the same file, so extract the 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–12 lines × 2) dll/src/desktop/shell2/android/mod.rs:2452— dll/src/desktop/shell2/android/mod.rs:2452-2460 | dll/src/desktop/shell2/android/mod.rs:3105-3116 — both copies are in the same file, so extract the 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–11 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5991— dll/src/desktop/shell2/linux/wayland/mod.rs:5991-5997 | dll/src/desktop/shell2/macos/events.rs:444-454 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/macos/events.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 2) doc/src/reftest/autodoc.rs:260— doc/src/reftest/autodoc.rs:260-270 | doc/src/reftest/autoreview.rs:90-96 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 3) dll/src/desktop/shell2/windows/mod.rs:4729— dll/src/desktop/shell2/windows/mod.rs:4729-4736 | dll/src/desktop/shell2/windows/mod.rs:4968-4977 | dll/src/desktop/shell2/windows/mod.rs:5060-5069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 3) webrender/core/src/picture.rs:1918— webrender/core/src/picture.rs:1918-1927 | webrender/core/src/picture.rs:2357-2364 | webrender/core/src/picture.rs:2454-2461 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 2) dll/src/desktop/shell2/common/layout.rs:561— dll/src/desktop/shell2/common/layout.rs:561-567 | dll/src/desktop/shell2/common/layout.rs:1135-1143 — both copies are in the same file, so extract the 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–9 lines × 2) layout/src/cpurender/svg.rs:61— layout/src/cpurender/svg.rs:61-69 | layout/src/cpurender/svg.rs:126-132 — both copies are in the same file, so extract the 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 × 8) dll/src/desktop/shell2/windows/mod.rs:4671— dll/src/desktop/shell2/windows/mod.rs:4671-4677 | dll/src/desktop/shell2/windows/mod.rs:4881-4887 | dll/src/desktop/shell2/windows/mod.rs:5022-5028 | dll/src/desktop/shell2/windows/mod.rs:5118-5124 | dll/src/desktop/shell2/windows/mod.rs:5168-5174 | dll/src/desktop/shell2/windows/mod.rs:5223-5229 | dll/src/desktop/shell2/windows/mod.rs:5251-5257 | dll/src/desktop/shell2/windows/mod.rs:5483-5489 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 8) doc/src/codegen/v2/lang_cpp/cpp03.rs:336— doc/src/codegen/v2/lang_cpp/cpp03.rs:336-342 | doc/src/codegen/v2/lang_cpp/cpp03.rs:696-702 | doc/src/codegen/v2/lang_cpp/cpp11.rs:243-249 | doc/src/codegen/v2/lang_cpp/cpp11.rs:618-624 | doc/src/codegen/v2/lang_cpp/cpp17.rs:400-406 | doc/src/codegen/v2/lang_cpp/cpp17.rs:828-834 | doc/src/codegen/v2/lang_cpp/cpp20.rs:952-958 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1077-1083 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 2) core/src/styled_dom.rs:1523— core/src/styled_dom.rs:1523-1529 | layout/src/xml/mod.rs:256-261 — 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–7 lines × 2) dll/src/desktop/shell2/macos/mod.rs:7005— dll/src/desktop/shell2/macos/mod.rs:7005-7010 | dll/src/desktop/shell2/macos/mod.rs:7012-7018 — both copies are in the same file, so extract the 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 × 6) dll/src/web/transpiler_remill.rs:1642— dll/src/web/transpiler_remill.rs:1642-1646 | dll/src/web/transpiler_remill.rs:1666-1670 | dll/src/web/transpiler_remill.rs:1692-1696 | dll/src/web/transpiler_remill.rs:1723-1727 | dll/src/web/transpiler_remill.rs:1795-1799 | dll/src/web/transpiler_remill.rs:1820-1824 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 6) layout/src/widgets/backstage.rs:351— layout/src/widgets/backstage.rs:351-355 | layout/src/widgets/backstage.rs:383-387 | layout/src/widgets/ribbon.rs:993-997 | layout/src/widgets/ribbon.rs:1270-1274 | layout/src/widgets/ribbon.rs:1326-1330 | layout/src/widgets/ribbon.rs:1440-1444 — before extracting anything, compare `layout/src/widgets/backstage.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2 locations) REDACTED:2255— REDACTED:2255 · REDACTED:2580 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (10 lines × 2 locations) REDACTED:2572— REDACTED:2572 · REDACTED:2929 — all 2 copies are in the same file, 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.
BatchBuilder::add_prim_to_batch (cyclomatic 131) webrender/core/src/batch.rs:815— BatchBuilder::add_prim_to_batch has cyclomatic complexity 131 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
HeadlessWindow::run (cyclomatic 92) dll/src/desktop/shell2/headless/mod.rs:2258— HeadlessWindow::run has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CpuBackend::render_frame (cyclomatic 88) dll/src/desktop/shell2/headless/mod.rs:549— CpuBackend::render_frame has cyclomatic complexity 88 (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.
azul-search.mount (cyclomatic 85) doc/templates/azul-search.js:559— azul-search.mount has cyclomatic complexity 85 (threshold 15). Of this number, 55 points are the body's own statements and 30 belong to 10 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.
RenderTaskKind::write_gpu_blocks (cyclomatic 67) webrender/core/src/render_task.rs:761— RenderTaskKind::write_gpu_blocks has cyclomatic complexity 67 (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.
FilterGraphOpKey::from (cyclomatic 58) webrender/core/src/prim_store/picture.rs:619— FilterGraphOpKey::from has cyclomatic complexity 58 (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.
DisplayListItem::is_visually_equal (cyclomatic 55) layout/src/solver3/display_list.rs:1883— DisplayListItem::is_visually_equal has cyclomatic complexity 55 (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.
CssProperty::interpolate (cyclomatic 50) css/src/props/property.rs:4900— CssProperty::interpolate has cyclomatic complexity 50 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_css::props::property::parse_css_property (cyclomatic 195) 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.
PictureCompositeKey::from (cyclomatic 50) webrender/core/src/prim_store/picture.rs:1086— PictureCompositeKey::from has cyclomatic complexity 50 (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.
lockfile_guard.main (cyclomatic 43) scripts/supply-chain/lockfile_guard.py:251— lockfile_guard.main 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.
RenderTaskGraphBuilder::end_frame (cyclomatic 41) webrender/core/src/render_task_graph.rs:258— RenderTaskGraphBuilder::end_frame has cyclomatic complexity 41 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Xml::scan_node (cyclomatic 37) core/src/xml.rs:414— Xml::scan_node 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
LazilyCompiledShader::get_internal (cyclomatic 37) webrender/core/src/renderer/shade.rs:180— LazilyCompiledShader::get_internal has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ModulePlan::build (cyclomatic 33) doc/src/codegen/v2/module_plan.rs:84— ModulePlan::build 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.
A11ySnapshot::build (cyclomatic 33) layout/src/managers/a11y_snapshot.rs:142— A11ySnapshot::build 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.
showComponentDetail (cyclomatic 33) REDACTED:2265— showComponentDetail has cyclomatic complexity 33 (threshold 15). Of this number, 26 points are the body's own statements and 7 belong to 18 function items 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.
_renderTreeNode (cyclomatic 30) REDACTED:656— _renderTreeNode has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to 5 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
render (cyclomatic 30) REDACTED:4113— render has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 4 of the 30 points are its own statements and the rest belongs to 16 function items inside it that branch (buildNode, buildNode::(anonymous), buildNode::(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.
azinput-portal.main (cyclomatic 29) scripts/debugging/azinput-portal.py:69— azinput-portal.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.
WaylandPopup::render_if_ready (cyclomatic 28) dll/src/desktop/shell2/linux/wayland/mod.rs:9622— WaylandPopup::render_if_ready 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.
SurfaceBuilder::pop_surface (cyclomatic 28) webrender/core/src/surface.rs:306— SurfaceBuilder::pop_surface has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CsSvgFilterNodeFrag::main (cyclomatic 28) webrender/swgl/src/shaders/cs_svg_filter_node.rs:239— CsSvgFilterNodeFrag::main has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
check_dep_justifications.main (cyclomatic 28) scripts/check_dep_justifications.py:122— check_dep_justifications.main 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.
env_guard.main (cyclomatic 28) scripts/supply-chain/env_guard.py:249— env_guard.main 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.
TypeResolver::check_type_c_compatibility_with_index (cyclomatic 27) doc/src/autofix/type_resolver.rs:434— TypeResolver::check_type_c_compatibility_with_index 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.
chrome_layout_extractor.allElements.forEach() (cyclomatic 27) doc/src/reftest/chrome_layout_extractor.js:22— chrome_layout_extractor.allElements.forEach() has cyclomatic complexity 27 (threshold 15). Of this number, 23 points are the body's own statements and 4 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.
azul-search.scoreEntry (cyclomatic 27) doc/templates/azul-search.js:61— azul-search.scoreEntry 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.
_loop (cyclomatic 27) REDACTED:4572— _loop has cyclomatic complexity 27 (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.
SceneBuilderThread::run (cyclomatic 26) webrender/core/src/scene_builder_thread.rs:304— SceneBuilderThread::run has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:149— BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs 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.
BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:151— BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs 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.
BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:137— BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs 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.
Vert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:142— Vert::brush_vs 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.
BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs (cyclomatic 26) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:127— BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs 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.
run_install_steps.run_route (cyclomatic 26) scripts/run_install_steps.py:85— run_install_steps.run_route 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.
strip_coff_lib.main (cyclomatic 26) scripts/strip_coff_lib.py:84— strip_coff_lib.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.
render (cyclomatic 26) REDACTED:3449— render has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
webrender_build::shader_features::get_shader_features (cyclomatic 25) webrender/build/src/shader_features.rs:60— webrender_build::shader_features::get_shader_features 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.
ComponentFieldType::parse_depth (cyclomatic 24) core/src/xml.rs:1511— ComponentFieldType::parse_depth 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. This is NOT this file's highest cyclomatic complexity: azul_core::xml::tag_to_node_type (cyclomatic 170) 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.
Ribbon::build_chrome (cyclomatic 24) layout/src/widgets/ribbon.rs:3210— Ribbon::build_chrome 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.
TileNode::maybe_merge_or_split (cyclomatic 24) webrender/core/src/picture.rs:7714— TileNode::maybe_merge_or_split has cyclomatic complexity 24 (threshold 15). Of this number, 23 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ctxCreateComponentFromSubtree (cyclomatic 24) REDACTED:1943— ctxCreateComponentFromSubtree has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 belong to 8 function items 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.
ConformancePlan::build (cyclomatic 23) doc/src/codegen/v2/conformance/mod.rs:147— ConformancePlan::build 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.
Cpp17Generator::generate_method_implementations (cyclomatic 23) doc/src/codegen/v2/lang_cpp/cpp17.rs:277— Cpp17Generator::generate_method_implementations 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.
ParsedFont::from_provider (cyclomatic 23) layout/src/font.rs:1011— ParsedFont::from_provider has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DenseText::from_unified_with_content (cyclomatic 23) layout/src/text3/dense.rs:223— DenseText::from_unified_with_content 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.
Tile::post_update (cyclomatic 23) webrender/core/src/picture.rs:1117— Tile::post_update 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: PictureCompositeMode::kind (cyclomatic 24) 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.
debugger._parseSlashCommand (cyclomatic 23) REDACTED:4753— debugger._parseSlashCommand 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.
azul-search.renderResults (cyclomatic 23) doc/templates/azul-search.js:501— azul-search.renderResults 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.
SegmentBuilder::build (cyclomatic 22) webrender/core/src/segment.rs:458— SegmentBuilder::build 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.
renderNodeDetail (cyclomatic 22) REDACTED:795— renderNodeDetail has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs 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.
_loadComponentPreview (cyclomatic 22) REDACTED:2590— _loadComponentPreview 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.
D1 · Cyclomatic Complexity· open (cyclomatic 22) · ×1
open (cyclomatic 22) REDACTED:4400— open has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 8 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 4452, 4507, 4417, …). 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.
PixelValue::resolve_with_context (cyclomatic 21) css/src/props/basic/pixel.rs:609— PixelValue::resolve_with_context 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.
SymbolTable::assign_synthetic_addresses (cyclomatic 21) dll/src/web/symbol_table.rs:756— SymbolTable::assign_synthetic_addresses 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.
CPUView::update_framebuffer (cyclomatic 21) dll/src/desktop/shell2/macos/mod.rs:2650— CPUView::update_framebuffer 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. This is NOT this file's highest cyclomatic complexity: azul_dll::desktop::shell2::macos::macos_event_name (cyclomatic 24) 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.
analyze_coverage.main (cyclomatic 21) scripts/analyze_coverage.py:49— analyze_coverage.main has cyclomatic complexity 21 (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.
init (cyclomatic 21) REDACTED:196— init 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.
Cpp03Generator::generate_method_implementations (cyclomatic 20) doc/src/codegen/v2/lang_cpp/cpp03.rs:236— Cpp03Generator::generate_method_implementations 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.
TextShapingCache::measure_intrinsic_widths (cyclomatic 20) layout/src/text3/cache.rs:8146— TextShapingCache::measure_intrinsic_widths 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.
BrushImageAntialiasingRepetitionTexture2DVert::brush_vs (cyclomatic 20) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:147— BrushImageAntialiasingRepetitionTexture2DVert::brush_vs 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.
BrushImageAntialiasingRepetitionTextureRectVert::brush_vs (cyclomatic 20) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:147— BrushImageAntialiasingRepetitionTextureRectVert::brush_vs 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.
azul-search.resolveDefaults (cyclomatic 20) doc/templates/azul-search.js:459— azul-search.resolveDefaults has cyclomatic complexity 20 (threshold 15). Of this number, 18 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 so the top-level body reads as a short sequence of named decisions.
_loadNodeClipInfo (cyclomatic 20) REDACTED:1313— _loadNodeClipInfo 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, 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.
_addCollapsible (cyclomatic 20) REDACTED:3335— _addCollapsible has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 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.
GlShader::draw (cyclomatic 19) core/src/gl.rs:4236— GlShader::draw 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.
GenE2eOptions::parse (cyclomatic 19) doc/src/gene2e.rs:175— GenE2eOptions::parse has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
StyleProperties::apply_override (cyclomatic 19) layout/src/text3/cache.rs:4979— StyleProperties::apply_override 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.
ImageData::update (cyclomatic 19) webrender/core/src/prim_store/image.rs:121— ImageData::update 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.
check_links.check_live (cyclomatic 19) scripts/check_links.py:157— check_links.check_live 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.
env_guard.scan_crate (cyclomatic 19) scripts/supply-chain/env_guard.py:195— env_guard.scan_crate 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.
sc_common._skip_to_item_body (cyclomatic 19) scripts/supply-chain/sc_common.py:470— sc_common._skip_to_item_body has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
scan_build_scripts.main (cyclomatic 19) scripts/supply-chain/scan_build_scripts.py:412— scan_build_scripts.main 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.
exportCode (cyclomatic 19) REDACTED:1588— exportCode 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.
PathParser::parse_number (cyclomatic 18) core/src/path_parser.rs:131— PathParser::parse_number 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.
TransientWindowConfig::apply_attr (cyclomatic 18) core/src/transient.rs:286— TransientWindowConfig::apply_attr has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Cpp11Generator::generate_method_implementations (cyclomatic 18) doc/src/codegen/v2/lang_cpp/cpp11.rs:146— Cpp11Generator::generate_method_implementations 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.
WorkspaceIndex::build_with_verbosity (cyclomatic 18) doc/src/patch/index.rs:519— WorkspaceIndex::build_with_verbosity 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.
FluentLocaleBundle::format (cyclomatic 18) layout/src/fluent.rs:218— FluentLocaleBundle::format has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PrimitiveComparer::compare_prim (cyclomatic 18) webrender/core/src/picture.rs:7450— PrimitiveComparer::compare_prim 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: PictureCompositeMode::kind (cyclomatic 24) 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.
Profiler::append_to_ui (cyclomatic 18) webrender/core/src/profiler.rs:1341— Profiler::append_to_ui has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AzulGamepad.onCapturedPointer (cyclomatic 18) scripts/android/AzulGamepad.java:252— AzulGamepad.onCapturedPointer 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.
cargo_bin_path.main (cyclomatic 18) scripts/cargo_bin_path.py:41— cargo_bin_path.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.
_loadNodeBoxModel (cyclomatic 18) REDACTED:1204— _loadNodeBoxModel 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: render (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.
SystemStyleDependencies::dom_depends_on_change (cyclomatic 17) core/src/callbacks.rs:1217— SystemStyleDependencies::dom_depends_on_change 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.
StyledDom::restyle_on_state_change (cyclomatic 17) core/src/styled_dom.rs:2153— StyledDom::restyle_on_state_change 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.
VecContents::insert_from_css_property (cyclomatic 17) css/src/codegen/format.rs:207— VecContents::insert_from_css_property has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: azul_css::codegen::format::format_style_filter (cyclomatic 22) 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.
AndroidAccessibilityAdapter::describe_node (cyclomatic 17) dll/src/desktop/shell2/android/accessibility.rs:166— AndroidAccessibilityAdapter::describe_node 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.
TypeDefinition::expand_macro_generated (cyclomatic 17) doc/src/autofix/type_index.rs:205— TypeDefinition::expand_macro_generated 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.
A11yTreeMirror::apply (cyclomatic 17) layout/src/managers/a11y.rs:178— A11yTreeMirror::apply 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. This is NOT this file's highest cyclomatic complexity: A11yManager::node_type_to_role (cyclomatic 74) 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.
TransientWindowManager::reconcile (cyclomatic 17) layout/src/transient.rs:836— TransientWindowManager::reconcile 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.
update (cyclomatic 17) REDACTED:4004— update 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. This is NOT this file's highest cyclomatic complexity: render (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.
DxgiCapture::read (cyclomatic 16) dll/src/desktop/extra/screencap/windows.rs:286— DxgiCapture::read 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.
VtDecoder::decode (cyclomatic 16) dll/src/desktop/extra/video_codec/videotoolbox.rs:903— VtDecoder::decode 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.
EnhancedXmlParser::extract_head_metadata (cyclomatic 16) doc/src/reftest/mod.rs:1219— EnhancedXmlParser::extract_head_metadata 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.
VirtualViewState::scroll_demand (cyclomatic 16) layout/src/managers/virtual_view.rs:613— VirtualViewState::scroll_demand 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.
sc_common._follow_includes (cyclomatic 16) scripts/supply-chain/sc_common.py:232— sc_common._follow_includes 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.
debugger._extractBase64Image (cyclomatic 16) REDACTED:4737— debugger._extractBase64Image 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.
azul-search.compositeAdapter (cyclomatic 16) doc/templates/azul-search.js:328— azul-search.compositeAdapter has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to 5 function literals inside it that branch (lines 344, 362, 369, …). 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.
updateStepParamsForm (cyclomatic 16) REDACTED:1095— updateStepParamsForm has cyclomatic complexity 16 (threshold 15). Of this number, 8 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. This is NOT this file's highest cyclomatic complexity: render (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.
_buildPlaceholderTree (cyclomatic 16) REDACTED:2682— _buildPlaceholderTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 2686). 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: render (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.
render (cyclomatic 16) REDACTED:4269— render 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 2 function literals inside it that branch (lines 4275, 4303). 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. This is NOT this file's highest cyclomatic complexity: render (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.
D12 · Dependency Hygiene· No Gemfile.lock committed by an application · ×1
No Gemfile.lock committed by an application — This repository declares 1 gem(s) across 1 Bundler manifest(s) and ships no application `.gemspec`, so it is an APPLICATION — but no `Gemfile.lock` is committed. Nothing records the versions a working build resolved to, so `bundle install` re-resolves against whatever rubygems.org serves today and two deploys of this commit are not guaranteed to be the same deploy. Run `bundle install` and commit the resulting `Gemfile.lock`. (A published GEM correctly omits its lock, which is why this is asked only of a repository that ships no .gemspec.)
BatchBuilder::add_prim_to_batch (cognitive 257) webrender/core/src/batch.rs:815— BatchBuilder::add_prim_to_batch has cognitive complexity 257 (threshold 15). Drivers by points: if/else 71 (125 pts), match/switch 28 (77 pts), loops 14 (43 pts), boolean chains 12 (nesting depth added 132). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HeadlessWindow::run (cognitive 220) dll/src/desktop/shell2/headless/mod.rs:2258— HeadlessWindow::run has cognitive complexity 220 (threshold 15). Drivers by points: if/else 59 (185 pts), match/switch 8 (25 pts), loops 4 (7 pts), boolean chains 3 (nesting depth added 146). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CpuBackend::render_frame (cognitive 118) dll/src/desktop/shell2/headless/mod.rs:549— CpuBackend::render_frame has cognitive complexity 118 (threshold 15). Drivers by points: if/else 50 (66 pts), match/switch 13 (25 pts), boolean chains 20, loops 3 (7 pts) (nesting depth added 32). 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.
RenderTaskGraphBuilder::end_frame (cognitive 94) webrender/core/src/render_task_graph.rs:258— RenderTaskGraphBuilder::end_frame has cognitive complexity 94 (threshold 15). Drivers by points: if/else 16 (49 pts), loops 15 (27 pts), match/switch 4 (16 pts), boolean chains 2 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul-search.mount (cognitive 94) doc/templates/azul-search.js:559— azul-search.mount has cognitive complexity 94 (threshold 15). Drivers by points: if/else 53 (67 pts), boolean chains 23, ternaries 2, error handling 1, loops 1 (nesting depth added 14). Of this number, 55 points are the body's own statements and 39 belong to 10 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, 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.
lockfile_guard.main (cognitive 81) scripts/supply-chain/lockfile_guard.py:251— lockfile_guard.main has cognitive complexity 81 (threshold 15). Drivers by points: if/else 25 (50 pts), ternaries 8 (17 pts), loops 5 (9 pts), boolean chains 5 (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.
A11ySnapshot::build (cognitive 78) layout/src/managers/a11y_snapshot.rs:142— A11ySnapshot::build has cognitive complexity 78 (threshold 15). Drivers by points: if/else 15 (45 pts), loops 7 (16 pts), match/switch 4 (15 pts), boolean chains 2 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderTask::new_svg_filter_graph (cognitive 75) webrender/core/src/render_task.rs:1643— RenderTask::new_svg_filter_graph has cognitive complexity 75 (threshold 15). Drivers by points: if/else 20 (49 pts), match/switch 5 (10 pts), loops 4 (9 pts), boolean chains 7 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SurfaceBuilder::pop_surface (cognitive 70) webrender/core/src/surface.rs:306— SurfaceBuilder::pop_surface has cognitive complexity 70 (threshold 15). Drivers by points: match/switch 11 (38 pts), loops 7 (23 pts), if/else 4 (9 pts) (nesting depth added 48). 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.
WaylandPopup::render_if_ready (cognitive 62) dll/src/desktop/shell2/linux/wayland/mod.rs:9622— WaylandPopup::render_if_ready has cognitive complexity 62 (threshold 15). Drivers by points: if/else 25 (49 pts), loops 1 (6 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModulePlan::build (cognitive 62) doc/src/codegen/v2/module_plan.rs:84— ModulePlan::build has cognitive complexity 62 (threshold 15). Drivers by points: if/else 13 (34 pts), loops 15 (21 pts), match/switch 2 (4 pts), boolean chains 3 (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.
Xml::scan_node (cognitive 59) core/src/xml.rs:414— Xml::scan_node has cognitive complexity 59 (threshold 15). Drivers by points: if/else 27 (49 pts), loops 3 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
debugger._parseSlashCommand (cognitive 48) REDACTED:4753— debugger._parseSlashCommand has cognitive complexity 48 (threshold 15). Drivers by points: if/else 17 (28 pts), error handling 2 (10 pts), loops 3 (5 pts), boolean chains 3, ternaries 1 (2 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.
RenderTaskKind::write_gpu_blocks (cognitive 47) webrender/core/src/render_task.rs:761— RenderTaskKind::write_gpu_blocks has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 2 (8 pts), match/switch 3 (5 pts) (nesting depth added 31). 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.
run_install_steps.run_route (cognitive 47) scripts/run_install_steps.py:85— run_install_steps.run_route has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (28 pts), ternaries 6 (12 pts), boolean chains 5, error handling 1, loops 1 (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.
strip_coff_lib.main (cognitive 45) scripts/strip_coff_lib.py:84— strip_coff_lib.main has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 9 (13 pts), ternaries 2 (7 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
env_guard.main (cognitive 44) scripts/supply-chain/env_guard.py:249— env_guard.main has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 8 (14 pts), ternaries 2 (5 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.
BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_2d.rs:149— BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTexture2DVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). 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.
BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_antialiasing_repetition_texture_rect.rs:151— BrushImageAdvancedBlendAlphaPassAntialiasingRepetitionTextureRectVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). 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.
BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_advanced_blend_alpha_pass_texture_2d.rs:137— BrushImageAdvancedBlendAlphaPassTexture2DVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). 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.
Vert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_2d.rs:142— Vert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). 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.
BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs (cognitive 43) webrender/swgl/src/shaders/brush_image_alpha_pass_antialiasing_dual_source_blending_repetition_texture_rect.rs:127— BrushImageAlphaPassAntialiasingDualSourceBlendingRepetitionTextureRectVert::brush_vs has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2, match/switch 2 (nesting depth added 20). 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.
Cpp03Generator::generate_method_implementations (cognitive 42) doc/src/codegen/v2/lang_cpp/cpp03.rs:236— Cpp03Generator::generate_method_implementations has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (33 pts), boolean chains 6, loops 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.
_addCollapsible (cognitive 42) REDACTED:3335— _addCollapsible has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (14 pts), ternaries 8 (11 pts), boolean chains 1 (nesting depth added 20). Of this number, 35 points are the body's own statements and 7 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.
BrushImageAntialiasingRepetitionTexture2DVert::brush_vs (cognitive 41) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_2d.rs:147— BrushImageAntialiasingRepetitionTexture2DVert::brush_vs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2 (nesting depth added 20). 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.
BrushImageAntialiasingRepetitionTextureRectVert::brush_vs (cognitive 41) webrender/swgl/src/shaders/brush_image_antialiasing_repetition_texture_rect.rs:147— BrushImageAntialiasingRepetitionTextureRectVert::brush_vs has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (39 pts), boolean chains 2 (nesting depth added 20). 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.
showComponentDetail (cognitive 40) REDACTED:2265— showComponentDetail has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 15, ternaries 1 (2 pts) (nesting depth added 8). Of this number, 28 points are the body's own statements and 12 belong to 18 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.
ImageData::update (cognitive 39) webrender/core/src/prim_store/image.rs:121— ImageData::update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 2 (5 pts), boolean chains 2, match/switch 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.
CPUView::update_framebuffer (cognitive 38) dll/src/desktop/shell2/macos/mod.rs:2650— CPUView::update_framebuffer has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (15 pts), boolean chains 7 (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.
check_dep_justifications.main (cognitive 38) scripts/check_dep_justifications.py:122— check_dep_justifications.main has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (17 pts), ternaries 7 (11 pts), loops 5 (6 pts), boolean chains 2, 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.
_renderTreeNode (cognitive 37) REDACTED:656— _renderTreeNode has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 10, ternaries 5 (6 pts) (nesting depth added 6). Of this number, 34 points are the body's own statements and 3 belong to 5 function literals inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
PathParser::parse_number (cognitive 36) core/src/path_parser.rs:131— PathParser::parse_number has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 3 (6 pts), boolean chains 3 (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.
EnhancedXmlParser::extract_head_metadata (cognitive 36) doc/src/reftest/mod.rs:1219— EnhancedXmlParser::extract_head_metadata has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (20 pts), match/switch 4 (12 pts), loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransientWindowManager::reconcile (cognitive 36) layout/src/transient.rs:836— TransientWindowManager::reconcile has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), boolean chains 4, loops 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
PrimitiveComparer::compare_prim (cognitive 36) webrender/core/src/picture.rs:7450— PrimitiveComparer::compare_prim has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SegmentBuilder::build (cognitive 36) webrender/core/src/segment.rs:458— SegmentBuilder::build has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (8 pts), boolean chains 4, match/switch 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.
azul-search.resolveDefaults (cognitive 36) doc/templates/azul-search.js:459— azul-search.resolveDefaults has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (12 pts), boolean chains 8, ternaries 1 (nesting depth added 16). Of this number, 34 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.
ApiTypeExtractor::extract_from_fn_args_array (cognitive 35) doc/src/autofix/analysis/extractor.rs:58— ApiTypeExtractor::extract_from_fn_args_array has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (29 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 23). 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.
Ribbon::build_chrome (cognitive 35) layout/src/widgets/ribbon.rs:3210— Ribbon::build_chrome has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), match/switch 3 (4 pts), loops 2 (3 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.
SceneSpatialTree::find_scroll_root (cognitive 35) webrender/core/src/spatial_tree.rs:331— SceneSpatialTree::find_scroll_root has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (24 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Cpp11Generator::generate_method_implementations (cognitive 34) doc/src/codegen/v2/lang_cpp/cpp11.rs:146— Cpp11Generator::generate_method_implementations has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 6, loops 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.
Tile::post_update (cognitive 34) webrender/core/src/picture.rs:1117— Tile::post_update has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 4 (8 pts), boolean chains 4, 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.
ConformancePlan::build (cognitive 33) doc/src/codegen/v2/conformance/mod.rs:147— ConformancePlan::build has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8, match/switch 3 (6 pts), boolean chains 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
webrender_build::shader_features::get_shader_features (cognitive 33) webrender/build/src/shader_features.rs:60— webrender_build::shader_features::get_shader_features has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 10 (11 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.
azinput-portal.main (cognitive 33) scripts/debugging/azinput-portal.py:69— azinput-portal.main has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (21 pts), ternaries 2 (6 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
init (cognitive 33) REDACTED:196— init has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (28 pts), error handling 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.
check_links.check_live (cognitive 32) scripts/check_links.py:157— check_links.check_live has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 4 (7 pts), ternaries 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.
azul-search.scoreEntry (cognitive 32) doc/templates/azul-search.js:61— azul-search.scoreEntry has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 6, loops 2 (4 pts), ternaries 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeDefinition::expand_macro_generated (cognitive 31) doc/src/autofix/type_index.rs:205— TypeDefinition::expand_macro_generated has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 2 (3 pts) (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.
ClipNodeInfo::create_instance (cognitive 30) webrender/core/src/clip.rs:979— ClipNodeInfo::create_instance has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (9 pts), boolean chains 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
FrameBuilder::render_minimap (cognitive 30) webrender/core/src/frame_builder.rs:720— FrameBuilder::render_minimap has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 1 (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.
sc_common._follow_includes (cognitive 30) scripts/supply-chain/sc_common.py:232— sc_common._follow_includes has cognitive complexity 30 (threshold 15). Drivers by points: error handling 4 (10 pts), if/else 4 (10 pts), loops 4 (7 pts), boolean chains 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.
chrome_layout_extractor.allElements.forEach() (cognitive 30) doc/src/reftest/chrome_layout_extractor.js:22— chrome_layout_extractor.allElements.forEach() has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 17, if/else 3 (4 pts), error handling 1 (3 pts), loops 1 (3 pts), ternaries 3 (nesting depth added 5). Of this number, 21 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.
CpuHitTester::rebuild_from_layout_with_gpu (cognitive 28) layout/src/headless.rs:794— CpuHitTester::rebuild_from_layout_with_gpu has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PictureCompositeMode::get_coverage_target_svgfe (cognitive 28) webrender/core/src/picture.rs:4634— PictureCompositeMode::get_coverage_target_svgfe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuadTileClassifier::classify (cognitive 28) webrender/core/src/quad.rs:1188— QuadTileClassifier::classify has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 3 (9 pts), loops 4 (7 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
renderNodeDetail (cognitive 28) REDACTED:795— renderNodeDetail has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 4, ternaries 1 (4 pts) (nesting depth added 6). Of this number, 24 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.
ctxCreateComponentFromSubtree (cognitive 28) REDACTED:1943— ctxCreateComponentFromSubtree has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 8, error handling 2 (3 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 8 belong to 8 function items 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, 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.
GpuStateManager::update_scrollbar_transforms (cognitive 27) layout/src/managers/gpu_state.rs:261— GpuStateManager::update_scrollbar_transforms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (26 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.
cargo_bin_path.main (cognitive 27) scripts/cargo_bin_path.py:41— cargo_bin_path.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 4, error handling 1 (2 pts), loops 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.
scan_build_scripts.main (cognitive 27) scripts/supply-chain/scan_build_scripts.py:412— scan_build_scripts.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 5 (8 pts), ternaries 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
_loop (cognitive 27) REDACTED:4572— _loop has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 9, error handling 1, ternaries 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.
DisplayListItem::is_visually_equal (cognitive 26) layout/src/solver3/display_list.rs:1883— DisplayListItem::is_visually_equal has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 24, if/else 1, match/switch 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.
BreakCursor::peek_next_unit (cognitive 26) layout/src/text3/cache.rs:13779— BreakCursor::peek_next_unit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (24 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.
AzulGamepad.onCapturedPointer (cognitive 26) scripts/android/AzulGamepad.java:252— AzulGamepad.onCapturedPointer has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 4, ternaries 3 (4 pts), loops 1 (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.
preflight_contracts.check_demo_naming (cognitive 26) scripts/preflight_contracts.py:53— preflight_contracts.check_demo_naming has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (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.
env_guard.scan_crate (cognitive 26) scripts/supply-chain/env_guard.py:195— env_guard.scan_crate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 3 (6 pts), boolean chains 5, error handling 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.
scan_build_scripts.evaluate (cognitive 26) scripts/supply-chain/scan_build_scripts.py:264— scan_build_scripts.evaluate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, 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.
updateStepParamsForm (cognitive 26) REDACTED:1095— updateStepParamsForm has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 3 (8 pts), boolean chains 7 (nesting depth added 8). Most of this is not in the body itself: 8 of the 26 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 1132, 1107, 1120, …). 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· open (cognitive 26) · ×1
open (cognitive 26) REDACTED:4400— open has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 8 (nesting depth added 5). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 4452, 4507, 4417, …). 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.
TileCacheBuilder::add_prim (cognitive 25) webrender/core/src/tile_cache.rs:289— TileCacheBuilder::add_prim has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
lockfile_guard.verify_vendor (cognitive 25) scripts/supply-chain/lockfile_guard.py:198— lockfile_guard.verify_vendor has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 3 (5 pts), boolean chains 3, error handling 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MapCss::parse (cognitive 24) dll/src/desktop/extra/map/svg.rs:107— MapCss::parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 2 (3 pts), match/switch 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.
AutofixMessages::print_report (cognitive 24) doc/src/autofix/message.rs:213— AutofixMessages::print_report has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (6 pts), boolean chains 1, 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.
A11yTreeMirror::apply (cognitive 24) layout/src/managers/a11y.rs:178— A11yTreeMirror::apply has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (6 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.
preflight_contracts.check_widget_wiring (cognitive 24) scripts/preflight_contracts.py:99— preflight_contracts.check_widget_wiring has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (4 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.
_showTreeContextMenu (cognitive 24) REDACTED:2778— _showTreeContextMenu has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 12). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (action::insertAfter, action::removeNode, action, …). 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.
Json::jq_all_recursive_depth (cognitive 23) core/src/json.rs:813— Json::jq_all_recursive_depth has cognitive complexity 23 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 4 (7 pts), match/switch 3 (7 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.
Surface::build (cognitive 23) doc/src/lint_examples.rs:341— Surface::build has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (10 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.
CssWarningCollector::validate_property (cognitive 23) doc/src/reftest/mod.rs:1444— CssWarningCollector::validate_property has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
analyze_coverage.main (cognitive 23) scripts/analyze_coverage.py:49— analyze_coverage.main has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 7, ternaries 4 (6 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.
check_links.check_local (cognitive 23) scripts/check_links.py:120— check_links.check_local has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (6 pts), boolean chains 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.
exportCode (cognitive 23) REDACTED:1588— exportCode has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8, error handling 3, ternaries 1 (2 pts) (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
update (cognitive 23) REDACTED:4004— update has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5 (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.
PatchSummary::print (cognitive 22) doc/src/autofix/message.rs:357— PatchSummary::print has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (13 pts), if/else 5, match/switch 1 (4 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CsBorderSegmentFrag::main (cognitive 22) webrender/swgl/src/shaders/cs_border_segment.rs:301— CsBorderSegmentFrag::main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 1, match/switch 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.
sc_common._skip_to_item_body (cognitive 22) scripts/supply-chain/sc_common.py:470— sc_common._skip_to_item_body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 2, 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.
_loadNodeClipInfo (cognitive 22) REDACTED:1313— _loadNodeClipInfo has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (8 pts), ternaries 2 (3 pts), error handling 1 (nesting depth added 3). 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.
terminalKeydown (cognitive 22) REDACTED:3011— terminalKeydown has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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.
VtDecoder::decode (cognitive 21) dll/src/desktop/extra/video_codec/videotoolbox.rs:903— VtDecoder::decode has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TypeIndex::resolve (cognitive 21) doc/src/autofix/type_index.rs:854— TypeIndex::resolve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 1 (2 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.
Ctx::plan_classes (cognitive 21) doc/src/codegen/v2/lang_fortran/wrappers.rs:293— Ctx::plan_classes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (4 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpaqueBatchList::set_params_and_get_batch (cognitive 21) webrender/core/src/batch.rs:432— OpaqueBatchList::set_params_and_get_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 12). 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.
SpatialTree::apply_updates (cognitive 21) webrender/core/src/spatial_tree.rs:873— SpatialTree::apply_updates has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (17 pts), match/switch 2 (3 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.
azul-search.renderResults (cognitive 21) doc/templates/azul-search.js:501— azul-search.renderResults has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (12 pts), boolean chains 5, if/else 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.
_loadComponentPreview (cognitive 21) REDACTED:2590— _loadComponentPreview has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 8, error handling 1, ternaries 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.
RawImage::paint_dot (cognitive 20) core/src/resources.rs:2324— RawImage::paint_dot has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), match/switch 2, 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.
SvgNode::is_closed (cognitive 20) core/src/svg.rs:692— SvgNode::is_closed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 4 (9 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DxgiCapture::read (cognitive 20) dll/src/desktop/extra/screencap/windows.rs:286— DxgiCapture::read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
InputChannel::start (cognitive 20) doc/src/reftest/telegram.rs:336— InputChannel::start has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts), match/switch 1 (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.
HoverManager::remap_node_ids (cognitive 20) layout/src/managers/hover.rs:484— HoverManager::remap_node_ids has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 3 (7 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.
CompactShapedEntry::build (cognitive 20) layout/src/text3/cache.rs:7057— CompactShapedEntry::build has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 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.
AlphaBatchList::set_params_and_get_batch (cognitive 20) webrender/core/src/batch.rs:329— AlphaBatchList::set_params_and_get_batch has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 pts), loops 1 (3 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.
CompositeState::push_surface (cognitive 20) webrender/core/src/composite.rs:734— CompositeState::push_surface has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Profiler::append_to_ui (cognitive 20) webrender/core/src/profiler.rs:1341— Profiler::append_to_ui has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MfCamera::read (cognitive 19) dll/src/desktop/extra/camera/windows.rs:369— MfCamera::read has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DpiFunctions::hwnd_dpi (cognitive 19) dll/src/desktop/shell2/windows/dpi.rs:220— DpiFunctions::hwnd_dpi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 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.
GestureAndDragManager::detect_click_count_for (cognitive 19) layout/src/managers/gesture.rs:1810— GestureAndDragManager::detect_click_count_for has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2, 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.
PatchState::build (cognitive 19) layout/src/solver3/display_list.rs:3787— PatchState::build has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
preflight_contracts.check_sparse_checkout (cognitive 19) scripts/preflight_contracts.py:148— preflight_contracts.check_sparse_checkout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), boolean chains 1, 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.
scan_build_scripts.classify (cognitive 19) scripts/supply-chain/scan_build_scripts.py:166— scan_build_scripts.classify has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 2 (4 pts), loops 2 (3 pts), error handling 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.
FluentLocalizerHandle::load_from_zip_with_locale (cognitive 18) layout/src/fluent.rs:505— FluentLocalizerHandle::load_from_zip_with_locale has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 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.
ContentOverlay::gc_converged_text (cognitive 18) layout/src/overlay.rs:476— ContentOverlay::gc_converged_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ResolvedContent::children_for_node (cognitive 18) layout/src/overlay.rs:593— ResolvedContent::children_for_node has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
StyleProperties::apply_override (cognitive 18) layout/src/text3/cache.rs:4979— StyleProperties::apply_override has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. 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.
ClipItemKind::get_clip_result (cognitive 18) webrender/core/src/clip.rs:1938— ClipItemKind::get_clip_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 6 (9 pts) (nesting depth added 7). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SwCompositeThread::take_job (cognitive 18) webrender/core/src/compositor/sw_compositor.rs:652— SwCompositeThread::take_job has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
ConicGradientTemplate::from (cognitive 18) webrender/core/src/prim_store/gradient/conic.rs:147— ConicGradientTemplate::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
LinearGradientTemplate::from (cognitive 18) webrender/core/src/prim_store/gradient/linear.rs:358— LinearGradientTemplate::from has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4 (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.
GradientGpuBlockBuilder::build (cognitive 18) webrender/core/src/prim_store/gradient/mod.rs:177— GradientGpuBlockBuilder::build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TextRunPrimitive::update_font_instance (cognitive 18) webrender/core/src/prim_store/text_run.rs:227— TextRunPrimitive::update_font_instance has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 3 (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.
SceneBuilderThread::forward_built_transactions (cognitive 18) webrender/core/src/scene_builder_thread.rs:676— SceneBuilderThread::forward_built_transactions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2, 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.
azul-search.compositeAdapter (cognitive 18) doc/templates/azul-search.js:328— azul-search.compositeAdapter has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 8, if/else 4 (6 pts), loops 3 (4 pts) (nesting depth added 3). Most of this is not in the body itself: 0 of the 18 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 344, 362, 369, …). 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.
render::buildNode (cognitive 18) REDACTED:4121— render::buildNode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 4, ternaries 2 (4 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.
runAllServerSide (cognitive 18) REDACTED:4687— runAllServerSide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 4698, 4693, 4701, …). 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.
CssMatcher::matches (cognitive 17) core/src/xml.rs:7047— CssMatcher::matches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VtEncoder::encode (cognitive 17) dll/src/desktop/extra/video_codec/videotoolbox.rs:633— VtEncoder::encode has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (5 pts), boolean chains 2, match/switch 1 (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.
WindowsMenuBar::recursive_construct_menu (cognitive 17) dll/src/desktop/shell2/windows/menu.rs:58— WindowsMenuBar::recursive_construct_menu has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RenderContext::build_node_attrs (cognitive 17) dll/src/web/html_render.rs:394— RenderContext::build_node_attrs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), 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.
ChromeCdp::send_command (cognitive 17) doc/src/reftest/autodebug.rs:246— ChromeCdp::send_command has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 1 (nesting depth added 11). 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.
ScrollbarState::hit_test_component (cognitive 17) layout/src/managers/scroll_state.rs:275— ScrollbarState::hit_test_component has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
DisplayListBuilder::push_inline_backgrounds_and_border (cognitive 17) layout/src/solver3/display_list.rs:2898— DisplayListBuilder::push_inline_backgrounds_and_border has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 pts), boolean chains 1, 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.
InstrumentKey::with_labels (cognitive 17) layout/src/telemetry/metrics.rs:215— InstrumentKey::with_labels has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UploadTexturePool::end_frame (cognitive 17) webrender/core/src/renderer/upload.rs:764— UploadTexturePool::end_frame has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (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.
scan_build_scripts.collect (cognitive 17) scripts/supply-chain/scan_build_scripts.py:215— scan_build_scripts.collect has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 4, if/else 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
azul-search.pagefindAdapter (cognitive 17) doc/templates/azul-search.js:229— azul-search.pagefindAdapter has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), loops 2 (4 pts), ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 254, 235, 248, …). 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.
SystemStyleDependencies::dom_depends_on_change (cognitive 16) core/src/callbacks.rs:1217— SystemStyleDependencies::dom_depends_on_change has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 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.
ChangeAccumulator::classify_change_scope (cognitive 16) core/src/diff.rs:1929— ChangeAccumulator::classify_change_scope has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 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.
NodeData::calculate_structural_hash (cognitive 16) core/src/dom.rs:3578— NodeData::calculate_structural_hash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), loops 3 (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.
DragContext::remap_node_ids (cognitive 16) core/src/drag.rs:708— DragContext::remap_node_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GlShader::draw (cognitive 16) core/src/gl.rs:4236— GlShader::draw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (6 pts), match/switch 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.
ColorU::apca_contrast (cognitive 16) css/src/props/basic/color.rs:777— ColorU::apca_contrast has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (16 pts) (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.
EglBackend::init (cognitive 16) dll/src/desktop/extra/screencap/dmabuf.rs:238— EglBackend::init has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 1, match/switch 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.
VideoDecoder::flush (cognitive 16) dll/src/desktop/extra/video_codec/mod.rs:730— VideoDecoder::flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (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.
AndroidAccessibilityAdapter::describe_node (cognitive 16) dll/src/desktop/shell2/android/accessibility.rs:166— AndroidAccessibilityAdapter::describe_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14, boolean chains 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.
KdeIni::parse (cognitive 16) dll/src/desktop/shell2/linux/system_style.rs:897— KdeIni::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 1, 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.
GlContext::new (cognitive 16) dll/src/desktop/shell2/linux/wayland/gl.rs:54— GlContext::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 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.
TypeParser::parse_inner (cognitive 16) doc/src/autofix/types/parser.rs:190— TypeParser::parse_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 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.
MethodPlan::implementation (cognitive 16) doc/src/codegen/v2/lang_ocaml/wrappers.rs:623— MethodPlan::implementation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Plan::header (cognitive 16) doc/src/codegen/v2/lang_swift/wrappers.rs:3746— Plan::header has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (15 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SymbolHierarchy::format (cognitive 16) doc/src/patch/parser.rs:815— SymbolHierarchy::format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DebugData::format (cognitive 16) doc/src/reftest/mod.rs:1668— DebugData::format has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 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.
VirtualViewState::scroll_demand (cognitive 16) layout/src/managers/virtual_view.rs:613— VirtualViewState::scroll_demand has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 9, if/else 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.
ShapeBoundary::from_css_shape (cognitive 16) layout/src/text3/cache.rs:4232— ShapeBoundary::from_css_shape has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 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.
ClusterFlags::classify (cognitive 16) layout/src/text3/cache.rs:5322— ClusterFlags::classify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, 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.
ClipBatcher::add (cognitive 16) webrender/core/src/batch.rs:3871— ClipBatcher::add has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 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.
Occluders::area (cognitive 16) webrender/core/src/composite.rs:1408— Occluders::area has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Texture::evict_old_blocks (cognitive 16) webrender/core/src/gpu_cache.rs:546— Texture::evict_old_blocks has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (7 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.
PictureCompositeKey::from (cognitive 16) webrender/core/src/prim_store/picture.rs:1086— PictureCompositeKey::from has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (10 pts), loops 2 (6 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TextureCache::evict_items_from_cache_if_required (cognitive 16) webrender/core/src/texture_cache.rs:1273— TextureCache::evict_items_from_cache_if_required has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 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.
PsQuadConicGradientVert::quad_primive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_conic_gradient.rs:102— PsQuadConicGradientVert::quad_primive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PsQuadMaskVert::quad_primive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_mask.rs:230— PsQuadMaskVert::quad_primive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PsQuadRadialGradientVert::quad_primitive_info (cognitive 16) webrender/swgl/src/shaders/ps_quad_radial_gradient.rs:86— PsQuadRadialGradientVert::quad_primitive_info has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AzulFilePicker.onActivityResultProxy (cognitive 16) scripts/android/AzulFilePicker.java:155— AzulFilePicker.onActivityResultProxy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 2, loops 1 (2 pts), 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.
sc_common.build_dependency_closure (cognitive 16) scripts/supply-chain/sc_common.py:395— sc_common.build_dependency_closure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (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.
_loadNodeBoxModel (cognitive 16) REDACTED:1204— _loadNodeBoxModel has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 2, error handling 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.
_loadNodeCssProperties (cognitive 16) REDACTED:1266— _loadNodeCssProperties has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 4, boolean chains 3, error handling 1 (nesting depth added 4). Of this number, 8 points are the body's own statements and 8 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.
_autoResolvePointers (cognitive 16) REDACTED:1351— _autoResolvePointers has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 11 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.
D22 · Internal API Consistency· Redundant naming for mutation vs immutable update. 'assign' implies mutation (void/return unit), while 'assigned' implies returning a new instance. However, both take a 'patch' and the return type of 'assign' is not explicitly shown as void but 'assigned' returns Self. In builder patterns, usually one method mutates and returns Self, or one returns a new instance. Having two methods with such similar names ('assign' vs 'assigned') for what is likely the same logical operation (merging patch data) is confusing. · ×1
Redundant naming for mutation vs immutable update. 'assign' implies mutation (void/return unit), while 'assigned' implies returning a new instance. However, both take a 'patch' and the return type of 'assign' is not explicitly shown as void but 'assigned' returns Self. In builder patterns, usually one method mutates and returns Self, or one returns a new instance. Having two methods with such similar names ('assign' vs 'assigned') for what is likely the same logical operation (merging patch data) is confusing. — Remove 'assign' if 'assigned' is the intended builder-style method, or rename 'assigned' to 'with_patch' or 'merge' to clarify intent. If 'assign' is in-place mutation, ensure its return type is clearly void/unit to distinguish from 'assigned'. (signatures: AccessibilityInfo.assign(patch: Self) | AccessibilityInfo.assigned(patch: Self): Self)
D22 · Internal API Consistency· Conflicting naming for Option unwrapping. 'into_option' typically implies consuming the wrapper to get the inner value (or the standard Option<T>). 'as_option' usually implies borrowing. However, both signatures return `AccessibilityAction` (owned), not `&AccessibilityAction`. This suggests 'as_option' is misnamed or 'into_option' is misnamed. Standard Rust convention is 'into_inner' or 'unwrap' for owned, and 'as_ref'/'as_mut' for borrowed. Using 'as_option' for an owned return is non-standard and confusing. · ×1
Conflicting naming for Option unwrapping. 'into_option' typically implies consuming the wrapper to get the inner value (or the standard Option<T>). 'as_option' usually implies borrowing. However, both signatures return `AccessibilityAction` (owned), not `&AccessibilityAction`. This suggests 'as_option' is misnamed or 'into_option' is misnamed. Standard Rust convention is 'into_inner' or 'unwrap' for owned, and 'as_ref'/'as_mut' for borrowed. Using 'as_option' for an owned return is non-standard and confusing. — Rename 'as_option' to 'unwrap' or 'into_inner' if it consumes the OptionAccessibilityAction. If it borrows, the return type should be `&AccessibilityAction`. Ensure consistency across all Option* types (OptionAccessibilityInfo, OptionAccessibilityRole, etc.). (signatures: OptionAccessibilityAction.into_option(): AccessibilityAction | OptionAccessibilityAction.as_option(): AccessibilityAction)
D22 · Internal API Consistency· Ambiguous naming for single-item construction. 'from_vec' suggests taking a collection (Vec), but the argument is a single `AccessibilityAction`. 'from_item' is clearer. Having both suggests 'from_vec' might be a typo or legacy name, or it takes a Vec in a different overload not shown, but the signature shows a single item. This creates confusion about whether to pass a single item or a collection. · ×1
Ambiguous naming for single-item construction. 'from_vec' suggests taking a collection (Vec), but the argument is a single `AccessibilityAction`. 'from_item' is clearer. Having both suggests 'from_vec' might be a typo or legacy name, or it takes a Vec in a different overload not shown, but the signature shows a single item. This creates confusion about whether to pass a single item or a collection. — Remove 'from_vec' if it only accepts a single item, or rename it to 'from_single' or 'from_item' and remove the duplicate 'from_item'. If 'from_vec' is intended for a Vec, the signature is incorrect. (signatures: AccessibilityActionVec.from_vec(input: AccessibilityAction): Self | AccessibilityActionVec.from_item(item: AccessibilityAction): Self)
D22 · Internal API Consistency· Inconsistent error handling for index access. 'get' returns the value directly (likely panicking on out-of-bounds), while 'c_get' returns an Option. This is a common pattern in C-FFI wrappers, but the naming 'c_get' is obscure. It should likely be 'get_safe' or 'try_get' to match standard Rust conventions, or 'get' should return an Option and 'get_unchecked' should return the value. · ×1
Inconsistent error handling for index access. 'get' returns the value directly (likely panicking on out-of-bounds), while 'c_get' returns an Option. This is a common pattern in C-FFI wrappers, but the naming 'c_get' is obscure. It should likely be 'get_safe' or 'try_get' to match standard Rust conventions, or 'get' should return an Option and 'get_unchecked' should return the value. — Rename 'c_get' to 'get_safe' or 'try_get' for clarity. Alternatively, make 'get' return Option and add 'get_unchecked' for the panicking version. (signatures: AccessibilityActionVec.c_get(index: usize): OptionAccessibilityAction | AccessibilityActionVec.get(index: usize): AccessibilityAction)
D4 · Code Duplication· Near-duplicate member family (15 members, 19 shared lines) · ×1
Near-duplicate member family (15 members, 19 shared lines) css/src/system.rs:2213— css/src/system.rs:2213-2261 | css/src/system.rs:2265-2313 | css/src/system.rs:2317-2365 | css/src/system.rs:2369-2417 | css/src/system.rs:2423-2470 | css/src/system.rs:2474-2528 | css/src/system.rs:2532-2577 | css/src/system.rs:2583-2629 | css/src/system.rs:2633-2679 | css/src/system.rs:2683-2728 | css/src/system.rs:2740-2806 | css/src/system.rs:2816-2884 | css/src/system.rs:2890-2935 | css/src/system.rs:2939-2984 | css/src/system.rs:2988-3031 — These 15 members are variants of one another: a block of 19 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 15 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 15 times.
D4 · Code Duplication· Near-duplicate member family (6 members, 43 shared lines) · ×1
Near-duplicate member family (6 members, 43 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:27— doc/src/codegen/v2/lang_cpp/cpp03.rs:27-124 | doc/src/codegen/v2/lang_cpp/cpp11.rs:28-134 | doc/src/codegen/v2/lang_cpp/cpp14.rs:23-120 | doc/src/codegen/v2/lang_cpp/cpp17.rs:26-138 | doc/src/codegen/v2/lang_cpp/cpp20.rs:36-145 | doc/src/codegen/v2/lang_cpp/cpp20.rs:432-526 — These 6 members are variants of one another: a block of 43 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 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.
D4 · Code Duplication· Near-duplicate member family (5 members, 35 shared lines) · ×1
Near-duplicate member family (5 members, 35 shared lines) layout/src/widgets/node_graph.rs:3622— layout/src/widgets/node_graph.rs:3622-3665 | layout/src/widgets/node_graph.rs:3671-3714 | layout/src/widgets/node_graph.rs:3720-3763 | layout/src/widgets/node_graph.rs:3769-3811 | layout/src/widgets/node_graph.rs:3817-3860 — These 5 members are variants of one another: a block of 35 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 28 shared lines) · ×1
Near-duplicate member family (5 members, 28 shared lines) dll/src/desktop/shell2/android/mod.rs:441— dll/src/desktop/shell2/android/mod.rs:441-532 | dll/src/desktop/shell2/ios/mod.rs:1893-1998 | dll/src/desktop/shell2/linux/wayland/mod.rs:6444-6536 | dll/src/desktop/shell2/linux/x11/mod.rs:6172-6276 | dll/src/desktop/shell2/windows/mod.rs:1817-1931 — These 5 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (5 members, 14 shared lines) · ×1
Near-duplicate member family (5 members, 14 shared lines) doc/src/codegen/v2/lang_crystal/types.rs:160— doc/src/codegen/v2/lang_crystal/types.rs:160-209 | doc/src/codegen/v2/lang_d/types.rs:130-166 | doc/src/codegen/v2/lang_julia/types.rs:198-242 | doc/src/codegen/v2/lang_odin/types.rs:144-186 | doc/src/codegen/v2/lang_v/types.rs:149-192 — These 5 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 113 shared lines) · ×1
Near-duplicate member family (4 members, 113 shared lines) doc/src/reftest/autodoc.rs:994— doc/src/reftest/autodoc.rs:994-1186 | doc/src/reftest/autoreview.rs:614-830 | doc/src/reftest/autoreview.rs:843-1065 | doc/src/reftest/autoreview.rs:1767-1966 — These 4 members are variants of one another: a block of 113 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 30 shared lines) · ×1
Near-duplicate member family (4 members, 30 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:627— doc/src/codegen/v2/lang_cpp/cpp03.rs:627-670 | doc/src/codegen/v2/lang_cpp/cpp11.rs:549-592 | doc/src/codegen/v2/lang_cpp/cpp17.rs:741-802 | doc/src/codegen/v2/lang_cpp/cpp20.rs:857-898 — These 4 members are variants of one another: a block of 30 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 27 shared lines) · ×1
Near-duplicate member family (4 members, 27 shared lines) doc/src/codegen/v2/lang_cpp/cpp03.rs:132— doc/src/codegen/v2/lang_cpp/cpp03.rs:132-234 | doc/src/codegen/v2/lang_cpp/cpp11.rs:650-763 | doc/src/codegen/v2/lang_cpp/cpp17.rs:146-275 | doc/src/codegen/v2/lang_cpp/cpp20.rs:623-745 — These 4 members are variants of one another: a block of 27 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 10 shared lines) · ×1
Near-duplicate member family (4 members, 10 shared lines) doc/src/reftest/autodebug.rs:2145— doc/src/reftest/autodebug.rs:2145-2273 | doc/src/reftest/autodoc.rs:892-985 | doc/src/reftest/autoreview.rs:1100-1215 | doc/src/reftest/autoreview.rs:1536-1654 — These 4 members are variants of one another: a block of 10 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 49 shared lines) · ×1
Near-duplicate member family (3 members, 49 shared lines) doc/src/codegen/v2/lang_node/wrappers.rs:418— doc/src/codegen/v2/lang_node/wrappers.rs:418-629 | doc/src/codegen/v2/lang_node/wrappers.rs:635-786 | doc/src/codegen/v2/lang_node/wrappers.rs:1102-1267 — These 3 members are variants of one another: a block of 49 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 17 shared lines) · ×1
Near-duplicate member family (3 members, 17 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:4618— dll/src/desktop/shell2/linux/wayland/mod.rs:4618-4682 | dll/src/desktop/shell2/linux/wayland/mod.rs:5639-5746 | dll/src/desktop/shell2/linux/wayland/mod.rs:5824-5900 — These 3 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 8 shared lines) · ×1
Near-duplicate member family (3 members, 8 shared lines) layout/src/solver3/display_list.rs:1005— layout/src/solver3/display_list.rs:1005-1044 | layout/src/solver3/display_list.rs:1068-1116 | layout/src/solver3/display_list.rs:1118-1152 — These 3 members are variants of one another: a block of 8 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
Near-duplicate member pair (205 shared lines) dll/src/desktop/shell2/linux/wayland/mod.rs:10845— dll/src/desktop/shell2/linux/wayland/mod.rs:10845-11091 | dll/src/desktop/shell2/linux/x11/mod.rs:8606-8842 — These two members are variants of one another: 205 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 (138 shared lines) layout/src/widgets/themes/flat.rs:1036— layout/src/widgets/themes/flat.rs:1036-1332 | layout/src/widgets/themes/flora.rs:1308-1724 — These two members are variants of one another: 138 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 (111 shared lines) layout/src/widgets/themes/flat.rs:567— layout/src/widgets/themes/flat.rs:567-696 | layout/src/widgets/themes/flora.rs:789-957 — These two members are variants of one another: 111 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 (104 shared lines) doc/src/api.rs:2009— doc/src/api.rs:2009-2216 | doc/src/api.rs:2281-2482 — These two members are variants of one another: 104 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 (89 shared lines) doc/src/codegen/v2/lang_rust.rs:2739— doc/src/codegen/v2/lang_rust.rs:2739-2961 | doc/src/codegen/v2/lang_rust.rs:2969-3353 — These two members are variants of one another: 89 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) layout/src/widgets/themes/flat.rs:1364— layout/src/widgets/themes/flat.rs:1364-1466 | layout/src/widgets/themes/flora.rs:1756-1873 — 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 (77 shared lines) doc/src/reftest/regression.rs:961— doc/src/reftest/regression.rs:961-1214 | doc/src/reftest/regression.rs:1751-2012 — These two members are variants of one another: 77 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 (64 shared lines) layout/src/widgets/themes/flat.rs:777— layout/src/widgets/themes/flat.rs:777-913 | layout/src/widgets/themes/flora.rs:1037-1185 — These two members are variants of one another: 64 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 (55 shared lines) layout/src/widgets/pagination.rs:202— layout/src/widgets/pagination.rs:202-333 | layout/src/widgets/segmented.rs:178-302 — These two members are variants of one another: 55 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 (53 shared lines) doc/src/codegen/v2/lang_java/types.rs:130— doc/src/codegen/v2/lang_java/types.rs:130-365 | doc/src/codegen/v2/lang_java/types.rs:480-735 — These two members are variants of one another: 53 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 (52 shared lines) doc/src/codegen/v2/lang_rust.rs:2594— doc/src/codegen/v2/lang_rust.rs:2594-2680 | doc/src/codegen/v2/rust/shared.rs:177-234 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (51 shared lines) layout/src/text3/cache.rs:6284— layout/src/text3/cache.rs:6284-6366 | layout/src/text3/cache.rs:6374-6455 — 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.
Near-duplicate member pair (49 shared lines) dll/src/desktop/shell2/linux/x11/mod.rs:4217— dll/src/desktop/shell2/linux/x11/mod.rs:4217-4297 | dll/src/desktop/shell2/windows/mod.rs:7636-7711 — These two members are variants of one another: 49 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 (47 shared lines) layout/src/widgets/themes/flat.rs:701— layout/src/widgets/themes/flat.rs:701-768 | layout/src/widgets/themes/flora.rs:962-1028 — These two members are variants of one another: 47 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 (44 shared lines) doc/src/codegen/v2/lang_lua/wrappers.rs:1078— doc/src/codegen/v2/lang_lua/wrappers.rs:1078-1146 | doc/src/codegen/v2/lang_lua/wrappers.rs:1150-1206 — These two members are variants of one another: 44 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 (41 shared lines) doc/src/codegen/v2/lang_rust.rs:2519— doc/src/codegen/v2/lang_rust.rs:2519-2586 | doc/src/codegen/v2/rust/shared.rs:128-174 — These two members are variants of one another: 41 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 (38 shared lines) layout/src/text3/edit.rs:770— layout/src/text3/edit.rs:770-898 | layout/src/text3/edit.rs:910-1017 — These two members are variants of one another: 38 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 (37 shared lines) core/src/resources.rs:2775— core/src/resources.rs:2775-2824 | core/src/resources.rs:2926-2975 — These two members are variants of one another: 37 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 (36 shared lines) layout/src/text3/cache.rs:6462— layout/src/text3/cache.rs:6462-6525 | layout/src/text3/cache.rs:6532-6595 — These two members are variants of one another: 36 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 (35 shared lines) doc/src/codegen/v2/lang_ruby/types.rs:990— doc/src/codegen/v2/lang_ruby/types.rs:990-1052 | doc/src/codegen/v2/lang_ruby/types.rs:1062-1122 — These two members are variants of one another: 35 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 (31 shared lines) doc/src/codegen/v2/lang_kotlin/wrappers.rs:197— doc/src/codegen/v2/lang_kotlin/wrappers.rs:197-252 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:261-303 — These two members are variants of one another: 31 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 (29 shared lines) dll/src/desktop/shell2/headless/mod.rs:1680— dll/src/desktop/shell2/headless/mod.rs:1680-1809 | dll/src/desktop/shell2/headless/mod.rs:1877-1945 — These two members are variants of one another: 29 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 (97 corresponding lines) · ×1
Edited copy of a member (97 corresponding lines) doc/src/patch/parser.rs:279— doc/src/patch/parser.rs:279-399 | doc/src/patch/parser.rs:401-511 — These two members are one piece of code written twice and then edited apart: 97 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) doc/src/reftest/regression.rs:1217— doc/src/reftest/regression.rs:1217-1292 | doc/src/reftest/regression.rs:1312-1411 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) dll/src/desktop/extra/geolocation/ios.rs:182— dll/src/desktop/extra/geolocation/ios.rs:182-217 | dll/src/desktop/extra/geolocation/macos.rs:176-211 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) layout/src/xml/svg.rs:1340— layout/src/xml/svg.rs:1340-1393 | layout/src/xml/svg.rs:1400-1453 — These two members are one piece of code written twice and then edited apart: 48 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 (20 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (20 members, 50+ identical tokens) doc/src/codegen/v2/lang_ada/functions.rs:64— doc/src/codegen/v2/lang_ada/functions.rs:64-125 | doc/src/codegen/v2/lang_algol68/functions.rs:64-125 | doc/src/codegen/v2/lang_cobol/functions.rs:70-131 | doc/src/codegen/v2/lang_csharp/functions.rs:125-188 | doc/src/codegen/v2/lang_fortran/functions.rs:85-147 | doc/src/codegen/v2/lang_freebasic/functions.rs:47-108 | doc/src/codegen/v2/lang_haskell/functions.rs:422-475 | doc/src/codegen/v2/lang_java/functions.rs:158-220 | doc/src/codegen/v2/lang_julia/mod.rs:409-470 | doc/src/codegen/v2/lang_kotlin/mod.rs:182-240 | doc/src/codegen/v2/lang_lisp/functions.rs:48-109 | doc/src/codegen/v2/lang_nim/functions.rs:49-110 | doc/src/codegen/v2/lang_ocaml/functions.rs:61-123 | doc/src/codegen/v2/lang_odin/mod.rs:330-391 | doc/src/codegen/v2/lang_pascal/functions.rs:94-156 | doc/src/codegen/v2/lang_racket/functions.rs:48-109 | doc/src/codegen/v2/lang_red/mod.rs:339-396 | doc/src/codegen/v2/lang_smalltalk/functions.rs:104-165 | doc/src/codegen/v2/lang_v/mod.rs:362-423 | doc/src/codegen/v2/lang_vb6/functions.rs:62-123 — These 20 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 20 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 20 times.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/defines.rs:751— dll/src/desktop/shell2/linux/wayland/defines.rs:751-786 | dll/src/desktop/shell2/linux/wayland/defines.rs:792-832 | dll/src/desktop/shell2/linux/wayland/defines.rs:839-874 | dll/src/desktop/shell2/linux/wayland/defines.rs:880-925 | dll/src/desktop/shell2/linux/wayland/defines.rs:932-967 | dll/src/desktop/shell2/linux/wayland/defines.rs:999-1071 | dll/src/desktop/shell2/linux/wayland/defines.rs:1077-1110 | dll/src/desktop/shell2/linux/wayland/defines.rs:1115-1150 | dll/src/desktop/shell2/linux/wayland/defines.rs:1156-1196 | dll/src/desktop/shell2/linux/wayland/defines.rs:1198-1248 | dll/src/desktop/shell2/linux/wayland/defines.rs:1250-1305 | dll/src/desktop/shell2/linux/wayland/defines.rs:1307-1362 | dll/src/desktop/shell2/linux/wayland/defines.rs:1364-1481 | dll/src/desktop/shell2/linux/wayland/defines.rs:1483-1530 | dll/src/desktop/shell2/linux/wayland/defines.rs:1537-1638 | dll/src/desktop/shell2/linux/wayland/defines.rs:1641-1675 — These 16 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 16 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 16 times.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) dll/src/desktop/shell2/linux/wayland/defines.rs:1920— dll/src/desktop/shell2/linux/wayland/defines.rs:1920-1971 | dll/src/desktop/shell2/linux/wayland/defines.rs:1972-2023 | dll/src/desktop/shell2/linux/wayland/defines.rs:2024-2065 | dll/src/desktop/shell2/linux/wayland/defines.rs:2126-2197 | dll/src/desktop/shell2/linux/wayland/defines.rs:2253-2379 | dll/src/desktop/shell2/linux/wayland/defines.rs:2420-2449 | dll/src/desktop/shell2/linux/wayland/defines.rs:2532-2566 | dll/src/desktop/shell2/linux/wayland/defines.rs:2568-2609 | dll/src/desktop/shell2/linux/wayland/defines.rs:2611-2654 | dll/src/desktop/shell2/linux/wayland/defines.rs:2656-2690 | dll/src/desktop/shell2/linux/wayland/defines.rs:2859-2888 | dll/src/desktop/shell2/linux/wayland/defines.rs:2922-2957 | dll/src/desktop/shell2/linux/wayland/defines.rs:2959-3005 | dll/src/desktop/shell2/linux/wayland/defines.rs:3008-3047 — These 14 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 14 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 14 times.
D4 · Code Duplication· Members sharing a duplicated core (12 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (12 members, 50+ identical tokens) css/src/props/basic/color.rs:899— css/src/props/basic/color.rs:899-907 | css/src/props/basic/color.rs:911-919 | css/src/props/basic/color.rs:923-931 | css/src/props/basic/color.rs:935-943 | css/src/props/basic/color.rs:947-955 | css/src/props/basic/color.rs:959-967 | css/src/props/basic/color.rs:971-979 | css/src/props/basic/color.rs:983-991 | css/src/props/basic/color.rs:995-1003 | css/src/props/basic/color.rs:1007-1015 | css/src/props/basic/color.rs:1019-1027 | css/src/props/basic/color.rs:1031-1039 — These 12 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 12 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 12 times.
Duplicated block (121 lines × 3) webrender/core/src/batch.rs:2903— webrender/core/src/batch.rs:2903-3023 | webrender/core/src/batch.rs:3030-3150 | webrender/core/src/batch.rs:3157-3277 — 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 (112–119 lines × 2) doc/src/codegen/v2/rust/dynamic_binding.rs:152— doc/src/codegen/v2/rust/dynamic_binding.rs:152-270 | doc/src/codegen/v2/rust/dynamic_binding.rs:281-392 — both copies are in the same file, so extract the 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 (94 lines × 2) doc/src/patch/parser.rs:297— doc/src/patch/parser.rs:297-390 | doc/src/patch/parser.rs:406-499 — both copies are in the same file, so extract the 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 (89–90 lines × 2) webrender/core/src/picture.rs:4351— webrender/core/src/picture.rs:4351-4439 | webrender/core/src/picture.rs:4490-4579 — both copies are in the same file, so extract the 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 (83 lines × 2) layout/src/widgets/alert.rs:112— layout/src/widgets/alert.rs:112-194 | layout/src/widgets/toast.rs:133-215 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (80 lines × 3) layout/src/widgets/node_graph.rs:1502— layout/src/widgets/node_graph.rs:1502-1581 | layout/src/widgets/node_graph.rs:1591-1670 | layout/src/widgets/node_graph.rs:1929-2008 — 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 (78–79 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1654— doc/src/codegen/v2/lang_kotlin/wrappers.rs:1654-1732 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1896-1973 — both copies are in the same file, so extract the 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 (74–76 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:175— dll/src/desktop/shell2/linux/wayland/gl.rs:175-248 | dll/src/desktop/shell2/linux/x11/gl.rs:189-264 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (74 lines × 2) layout/src/widgets/themes/flat.rs:589— layout/src/widgets/themes/flat.rs:589-662 | layout/src/widgets/themes/flora.rs:811-884 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (65–70 lines × 2) layout/src/widgets/themes/flat.rs:1365— layout/src/widgets/themes/flat.rs:1365-1429 | layout/src/widgets/themes/flora.rs:1757-1826 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (65 lines × 2) webrender/core/src/render_task.rs:2429— webrender/core/src/render_task.rs:2429-2493 | webrender/core/src/render_task.rs:2557-2621 — both copies are in the same file, so extract the 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 (62–63 lines × 2) layout/src/widgets/themes/flat.rs:1077— layout/src/widgets/themes/flat.rs:1077-1138 | layout/src/widgets/themes/flora.rs:1441-1503 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (58–59 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:328— doc/src/codegen/v2/lang_cpp/cpp11.rs:328-386 | doc/src/codegen/v2/lang_cpp/cpp17.rs:508-565 | doc/src/codegen/v2/lang_cpp/cpp20.rs:194-252 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (55–57 lines × 2) doc/src/codegen/v2/rust/static_binding.rs:239— doc/src/codegen/v2/rust/static_binding.rs:239-295 | doc/src/codegen/v2/rust/static_binding.rs:306-360 — both copies are in the same file, so extract the 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 (50–57 lines × 2) doc/src/codegen/v2/lang_lisp/types.rs:44— doc/src/codegen/v2/lang_lisp/types.rs:44-100 | doc/src/codegen/v2/lang_racket/types.rs:42-91 — `doc/src/codegen/v2/lang_lisp/types.rs` and `doc/src/codegen/v2/lang_racket/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 84 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (45–56 lines × 2) dll/src/desktop/shell2/android/mod.rs:1711— dll/src/desktop/shell2/android/mod.rs:1711-1766 | dll/src/desktop/shell2/android/mod.rs:1918-1962 — both copies are in the same file, so extract the 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–54 lines × 2) dll/src/desktop/shell2/headless/mod.rs:1719— dll/src/desktop/shell2/headless/mod.rs:1719-1772 | dll/src/desktop/shell2/ios/mod.rs:1936-1974 — `dll/src/desktop/shell2/headless/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 136 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (46–53 lines × 2) dll/src/web/transpiler_remill.rs:1345— dll/src/web/transpiler_remill.rs:1345-1397 | dll/src/web/transpiler_remill.rs:6700-6745 — both copies are in the same file, so extract the 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 (44–52 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:651— doc/src/codegen/v2/lang_cpp/cpp11.rs:651-694 | doc/src/codegen/v2/lang_cpp/cpp17.rs:147-198 | doc/src/codegen/v2/lang_cpp/cpp20.rs:624-667 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (47–51 lines × 2) core/src/xml.rs:7241— core/src/xml.rs:7241-7287 | core/src/xml.rs:7497-7547 — both copies are in the same file, so extract the 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 (42–51 lines × 2) layout/src/solver3/fc.rs:8890— layout/src/solver3/fc.rs:8890-8931 | layout/src/solver3/fc.rs:9419-9469 — both copies are in the same file, so extract the 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 (45–50 lines × 2) doc/src/main.rs:1358— doc/src/main.rs:1358-1402 | doc/src/main.rs:1433-1482 — both copies are in the same file, so extract the 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 (49 lines × 2) dll/src/desktop/shell2/linux/wayland/gl.rs:104— dll/src/desktop/shell2/linux/wayland/gl.rs:104-152 | dll/src/desktop/shell2/linux/x11/gl.rs:102-150 — `dll/src/desktop/shell2/linux/wayland/gl.rs` and `dll/src/desktop/shell2/linux/x11/gl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 133 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (47–48 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1838— doc/src/codegen/v2/lang_csharp/wrappers.rs:1838-1884 | doc/src/codegen/v2/lang_csharp/wrappers.rs:1886-1933 — both copies are in the same file, so extract the 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 (40–47 lines × 2) doc/src/codegen/v2/lang_crystal/types.rs:45— doc/src/codegen/v2/lang_crystal/types.rs:45-91 | doc/src/codegen/v2/lang_d/types.rs:43-82 — `doc/src/codegen/v2/lang_crystal/types.rs` and `doc/src/codegen/v2/lang_d/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 67 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (46 lines × 2) doc/src/codegen/v2/lang_odin/types.rs:39— doc/src/codegen/v2/lang_odin/types.rs:39-84 | doc/src/codegen/v2/lang_v/types.rs:39-84 — `doc/src/codegen/v2/lang_odin/types.rs` and `doc/src/codegen/v2/lang_v/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 16 separate duplicated blocks between them, totalling at least 175 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (41–46 lines × 2) layout/src/text3/cache.rs:7981— layout/src/text3/cache.rs:7981-8026 | layout/src/text3/cache.rs:8184-8224 — both copies are in the same file, so extract the 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 (38–45 lines × 2) core/src/diff.rs:383— core/src/diff.rs:383-427 | core/src/diff.rs:1448-1485 — both copies are in the same file, so extract the 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 (41–44 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:703— doc/src/codegen/v2/lang_cpp/cpp11.rs:703-743 | doc/src/codegen/v2/lang_cpp/cpp17.rs:214-255 | doc/src/codegen/v2/lang_cpp/cpp20.rs:679-722 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (39–42 lines × 2) dll/src/desktop/shell2/linux/x11/mod.rs:6948— dll/src/desktop/shell2/linux/x11/mod.rs:6948-6989 | dll/src/desktop/shell2/windows/mod.rs:1660-1698 — before extracting anything, compare `dll/src/desktop/shell2/linux/x11/mod.rs` and `dll/src/desktop/shell2/windows/mod.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 443 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (41–42 lines × 2) doc/src/codegen/v2/lang_rust.rs:2470— doc/src/codegen/v2/lang_rust.rs:2470-2511 | doc/src/codegen/v2/rust/shared.rs:85-125 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (38–41 lines × 2) doc/src/codegen/v2/lang_freebasic/types.rs:45— doc/src/codegen/v2/lang_freebasic/types.rs:45-85 | doc/src/codegen/v2/lang_vb6/types.rs:66-103 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (40–41 lines × 2) webrender/core/src/batch.rs:2410— webrender/core/src/batch.rs:2410-2449 | webrender/core/src/batch.rs:2541-2581 — both copies are in the same file, so extract the 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 (23–39 lines × 2) core/src/styled_dom.rs:1985— core/src/styled_dom.rs:1985-2007 | core/src/styled_dom.rs:2167-2205 — both copies are in the same file, so extract the 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 (33–39 lines × 2) dll/src/desktop/shell2/macos/mod.rs:4266— dll/src/desktop/shell2/macos/mod.rs:4266-4304 | dll/src/desktop/shell2/macos/mod.rs:4351-4383 — both copies are in the same file, so extract the 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 (38–39 lines × 2) layout/src/cpurender/compositor.rs:3127— layout/src/cpurender/compositor.rs:3127-3164 | layout/src/cpurender/compositor.rs:3195-3233 — both copies are in the same file, so extract the 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 (38 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:491— doc/src/codegen/v2/lang_cpp/cpp03.rs:491-528 | doc/src/codegen/v2/lang_cpp/cpp11.rs:394-431 | doc/src/codegen/v2/lang_cpp/cpp17.rs:573-610 | doc/src/codegen/v2/lang_cpp/cpp20.rs:260-297 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (36–38 lines × 3) doc/src/reftest/autoreview.rs:618— doc/src/reftest/autoreview.rs:618-653 | doc/src/reftest/autoreview.rs:847-884 | doc/src/reftest/autoreview.rs:1771-1807 — 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 (38 lines × 2) doc/src/reftest/regression.rs:1221— doc/src/reftest/regression.rs:1221-1258 | doc/src/reftest/regression.rs:1316-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 (36–37 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:342— doc/src/codegen/v2/lang_cpp/cpp03.rs:342-378 | doc/src/codegen/v2/lang_cpp/cpp11.rs:249-284 | doc/src/codegen/v2/lang_cpp/cpp17.rs:406-441 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (35–37 lines × 2) doc/src/autofix/function_diff.rs:1437— doc/src/autofix/function_diff.rs:1437-1473 | doc/src/autofix/function_diff.rs:1507-1541 — both copies are in the same file, so extract the 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 (35–36 lines × 5) layout/src/widgets/node_graph.rs:3623— layout/src/widgets/node_graph.rs:3623-3658 | layout/src/widgets/node_graph.rs:3672-3707 | layout/src/widgets/node_graph.rs:3721-3756 | layout/src/widgets/node_graph.rs:3770-3804 | layout/src/widgets/node_graph.rs:3818-3853 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (36 lines × 3) dll/src/desktop/compositor2.rs:1659— dll/src/desktop/compositor2.rs:1659-1694 | dll/src/desktop/compositor2.rs:1848-1883 | dll/src/desktop/compositor2.rs:1970-2005 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–36 lines × 3) core/src/window.rs:2585— core/src/window.rs:2585-2587 | css/src/props/property.rs:1576-1592 | css/src/props/property.rs:1801-1836 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (36 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:363— doc/src/codegen/v2/lang_go/wrappers.rs:363-398 | doc/src/codegen/v2/lang_go/wrappers.rs:458-493 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–35 lines × 2) dll/src/web/transpiler_remill.rs:10935— dll/src/web/transpiler_remill.rs:10935-10960 | dll/src/web/transpiler_remill.rs:11066-11100 — both copies are in the same file, so extract the 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 (35 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1610— doc/src/codegen/v2/lang_kotlin/wrappers.rs:1610-1644 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1851-1885 — both copies are in the same file, so extract the 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 (33–34 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:5004— dll/src/desktop/shell2/linux/wayland/mod.rs:5004-5036 | dll/src/desktop/shell2/linux/x11/events.rs:942-974 | dll/src/desktop/shell2/windows/mod.rs:5600-5633 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (34 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:679— doc/src/codegen/v2/lang_cpp/cpp03.rs:679-712 | doc/src/codegen/v2/lang_cpp/cpp11.rs:601-634 | doc/src/codegen/v2/lang_cpp/cpp17.rs:811-844 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33–34 lines × 2) doc/src/codegen/v2/lang_swift/wrappers.rs:1035— doc/src/codegen/v2/lang_swift/wrappers.rs:1035-1067 | doc/src/codegen/v2/lang_swift/wrappers.rs:3172-3205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–34 lines × 2) layout/src/text3/cache.rs:7927— layout/src/text3/cache.rs:7927-7960 | layout/src/text3/cache.rs:8156-8181 — both copies are in the same file, so extract the 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 (34 lines × 2) layout/src/widgets/themes/flat.rs:1470— layout/src/widgets/themes/flat.rs:1470-1503 | layout/src/widgets/themes/flora.rs:1877-1910 — before extracting anything, compare `layout/src/widgets/themes/flat.rs` and `layout/src/widgets/themes/flora.rs` as WHOLE FILES: this scan already matched 33 separate duplicated blocks between them, totalling at least 733 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32–33 lines × 2) layout/src/solver3/fc.rs:8856— layout/src/solver3/fc.rs:8856-8887 | layout/src/solver3/fc.rs:9380-9412 — both copies are in the same file, so extract the 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 (27–32 lines × 4) doc/src/codegen/v2/lang_cpp/cpp11.rs:74— doc/src/codegen/v2/lang_cpp/cpp11.rs:74-103 | doc/src/codegen/v2/lang_cpp/cpp14.rs:59-85 | doc/src/codegen/v2/lang_cpp/cpp17.rs:73-104 | doc/src/codegen/v2/lang_cpp/cpp20.rs:83-111 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28–32 lines × 2) dll/src/desktop/shell2/run.rs:1315— dll/src/desktop/shell2/run.rs:1315-1346 | dll/src/desktop/shell2/run.rs:1497-1524 — both copies are in the same file, so extract the 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 (30–32 lines × 2) doc/src/codegen/v2/lang_cpp/cpp17.rs:624— doc/src/codegen/v2/lang_cpp/cpp17.rs:624-655 | doc/src/codegen/v2/lang_cpp/cpp20.rs:325-354 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp17.rs` and `doc/src/codegen/v2/lang_cpp/cpp20.rs` as WHOLE FILES: this scan already matched 29 separate duplicated blocks between them, totalling at least 598 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27–32 lines × 2) doc/src/codegen/v2/lang_node/wrappers.rs:453— doc/src/codegen/v2/lang_node/wrappers.rs:453-484 | doc/src/codegen/v2/lang_node/wrappers.rs:1145-1171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31–32 lines × 2) doc/src/codegen/v2/lang_rust.rs:2431— doc/src/codegen/v2/lang_rust.rs:2431-2462 | doc/src/codegen/v2/rust/shared.rs:47-77 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23–32 lines × 2) layout/src/solver3/cache.rs:2055— layout/src/solver3/cache.rs:2055-2086 | layout/src/solver3/cache.rs:2196-2218 — both copies are in the same file, so extract the 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 (32 lines × 2) layout/src/xml/svg.rs:1341— layout/src/xml/svg.rs:1341-1372 | layout/src/xml/svg.rs:1401-1432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10916— dll/src/desktop/shell2/linux/wayland/mod.rs:10916-10946 | dll/src/desktop/shell2/linux/x11/mod.rs:8673-8703 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (26–31 lines × 2) webrender/core/src/quad.rs:210— webrender/core/src/quad.rs:210-240 | webrender/core/src/quad.rs:635-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–30 lines × 4) doc/src/reftest/autodoc.rs:1065— doc/src/reftest/autodoc.rs:1065-1090 | doc/src/reftest/autoreview.rs:700-729 | doc/src/reftest/autoreview.rs:936-965 | doc/src/reftest/autoreview.rs:1841-1868 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28–30 lines × 3) doc/src/reftest/regression.rs:900— doc/src/reftest/regression.rs:900-927 | doc/src/reftest/regression.rs:1004-1033 | doc/src/reftest/regression.rs:1797-1826 — 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 (29–30 lines × 2) doc/src/api.rs:1847— doc/src/api.rs:1847-1876 | doc/src/api.rs:1895-1923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–28 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:307— doc/src/codegen/v2/lang_cpp/cpp03.rs:307-326 | doc/src/codegen/v2/lang_cpp/cpp11.rs:206-233 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1050-1069 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:479— doc/src/codegen/v2/lang_cpp/cpp11.rs:479-506 | doc/src/codegen/v2/lang_cpp/cpp17.rs:668-695 | doc/src/codegen/v2/lang_cpp/cpp20.rs:367-394 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp17.rs` as WHOLE FILES: this scan already matched 38 separate duplicated blocks between them, totalling at least 759 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25–28 lines × 3) doc/src/reftest/autodoc.rs:1142— doc/src/reftest/autodoc.rs:1142-1166 | doc/src/reftest/autoreview.rs:782-809 | doc/src/reftest/autoreview.rs:1921-1946 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26–28 lines × 2) dll/src/desktop/extra/geolocation/mod.rs:37— dll/src/desktop/extra/geolocation/mod.rs:37-62 | dll/src/desktop/extra/permission/mod.rs:38-65 — 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 (27–28 lines × 2) doc/src/codegen/v2/lang_ada/functions.rs:243— doc/src/codegen/v2/lang_ada/functions.rs:243-269 | doc/src/codegen/v2/lang_ada/mod.rs:284-311 — 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 (23–27 lines × 10) dll/src/desktop/shell2/macos/mod.rs:300— dll/src/desktop/shell2/macos/mod.rs:300-323 | dll/src/desktop/shell2/macos/mod.rs:347-369 | dll/src/desktop/shell2/macos/mod.rs:376-398 | dll/src/desktop/shell2/macos/mod.rs:406-428 | dll/src/desktop/shell2/macos/mod.rs:669-695 | dll/src/desktop/shell2/macos/mod.rs:703-725 | dll/src/desktop/shell2/macos/mod.rs:733-755 | dll/src/desktop/shell2/macos/mod.rs:762-784 | dll/src/desktop/shell2/macos/mod.rs:791-813 | dll/src/desktop/shell2/macos/mod.rs:820-842 — all 10 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 (26–27 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:83— doc/src/codegen/v2/lang_cpp/cpp03.rs:83-109 | doc/src/codegen/v2/lang_cpp/cpp11.rs:93-119 | doc/src/codegen/v2/lang_cpp/cpp14.rs:75-100 | doc/src/codegen/v2/lang_cpp/cpp17.rs:94-120 | doc/src/codegen/v2/lang_cpp/cpp20.rs:101-127 | doc/src/codegen/v2/lang_cpp/cpp20.rs:485-510 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–27 lines × 3) doc/src/codegen/v2/lang_cpp/cpp03.rs:322— doc/src/codegen/v2/lang_cpp/cpp03.rs:322-340 | doc/src/codegen/v2/lang_cpp/cpp11.rs:221-247 | doc/src/codegen/v2/lang_cpp/cpp17.rs:386-404 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (25–27 lines × 3) doc/src/reftest/apply_midlevel.rs:379— doc/src/reftest/apply_midlevel.rs:379-405 | doc/src/reftest/apply_midlevel.rs:1413-1437 | doc/src/reftest/apply_midlevel.rs:1615-1639 — 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 (20–27 lines × 2) core/src/styled_dom.rs:1782— core/src/styled_dom.rs:1782-1801 | core/src/styled_dom.rs:2322-2348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19–27 lines × 2) css/src/props/basic/font.rs:803— css/src/props/basic/font.rs:803-821 | layout/src/text3/default.rs:258-284 — 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–27 lines × 2) doc/src/codegen/v2/lang_rust.rs:2634— doc/src/codegen/v2/lang_rust.rs:2634-2660 | doc/src/codegen/v2/rust/shared.rs:198-214 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 2) layout/src/widgets/camera.rs:414— layout/src/widgets/camera.rs:414-440 | layout/src/widgets/screencap.rs:364-390 — before extracting anything, compare `layout/src/widgets/camera.rs` and `layout/src/widgets/screencap.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (26–27 lines × 2) layout/src/window.rs:19500— layout/src/window.rs:19500-19526 | layout/src/window.rs:19602-19627 — both copies are in the same file, so extract the 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 (25–26 lines × 5) webrender/core/src/batch.rs:2424— webrender/core/src/batch.rs:2424-2449 | webrender/core/src/batch.rs:2556-2581 | webrender/core/src/batch.rs:2955-2979 | webrender/core/src/batch.rs:3082-3106 | webrender/core/src/batch.rs:3209-3233 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (25–26 lines × 2) doc/src/autofix/type_resolver.rs:624— doc/src/autofix/type_resolver.rs:624-648 | doc/src/autofix/type_resolver.rs:678-703 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–26 lines × 2) layout/src/solver3/sizing.rs:2527— layout/src/solver3/sizing.rs:2527-2552 | layout/src/solver3/sizing.rs:2686-2702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–25 lines × 3) doc/src/codegen/v2/lang_rust.rs:4854— doc/src/codegen/v2/lang_rust.rs:4854-4878 | doc/src/codegen/v2/lang_rust.rs:4909-4933 | doc/src/codegen/v2/rust/static_binding.rs:535-555 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/static_binding.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 3) webrender/core/src/batch.rs:1584— webrender/core/src/batch.rs:1584-1608 | webrender/core/src/batch.rs:2235-2259 | webrender/core/src/batch.rs:2278-2302 — 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 (20–25 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3531— dll/src/desktop/shell2/linux/wayland/mod.rs:3531-3555 | dll/src/desktop/shell2/linux/wayland/mod.rs:5348-5367 — both copies are in the same file, so extract the 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 (22–25 lines × 2) doc/src/autofix/type_index.rs:3394— doc/src/autofix/type_index.rs:3394-3418 | doc/src/autotest/extract.rs:353-374 — 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 (24 lines × 18) doc/src/codegen/v2/lang_ada/functions.rs:102— doc/src/codegen/v2/lang_ada/functions.rs:102-125 | doc/src/codegen/v2/lang_algol68/functions.rs:102-125 | doc/src/codegen/v2/lang_cobol/functions.rs:108-131 | doc/src/codegen/v2/lang_csharp/functions.rs:165-188 | doc/src/codegen/v2/lang_fortran/functions.rs:124-147 | doc/src/codegen/v2/lang_freebasic/functions.rs:85-108 | doc/src/codegen/v2/lang_haskell/functions.rs:452-475 | doc/src/codegen/v2/lang_java/functions.rs:197-220 | doc/src/codegen/v2/lang_julia/mod.rs:447-470 | doc/src/codegen/v2/lang_lisp/functions.rs:86-109 | doc/src/codegen/v2/lang_nim/functions.rs:87-110 | doc/src/codegen/v2/lang_ocaml/functions.rs:100-123 | doc/src/codegen/v2/lang_odin/mod.rs:368-391 | doc/src/codegen/v2/lang_pascal/functions.rs:133-156 | doc/src/codegen/v2/lang_racket/functions.rs:86-109 | doc/src/codegen/v2/lang_smalltalk/functions.rs:142-165 | doc/src/codegen/v2/lang_v/mod.rs:400-423 | doc/src/codegen/v2/lang_vb6/functions.rs:100-123 — `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_pascal/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (14–24 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:319— doc/src/codegen/v2/lang_cpp/cpp03.rs:319-334 | doc/src/codegen/v2/lang_cpp/cpp11.rs:218-241 | doc/src/codegen/v2/lang_cpp/cpp17.rs:383-398 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1062-1075 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23–24 lines × 4) doc/src/reftest/autodoc.rs:1092— doc/src/reftest/autodoc.rs:1092-1114 | doc/src/reftest/autoreview.rs:731-754 | doc/src/reftest/autoreview.rs:967-990 | doc/src/reftest/autoreview.rs:1870-1893 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20–24 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:2571— dll/src/desktop/shell2/linux/wayland/events.rs:2571-2590 | dll/src/desktop/shell2/linux/x11/mod.rs:1503-1526 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/events.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21–24 lines × 2) doc/src/reftest/autodoc.rs:1030— doc/src/reftest/autodoc.rs:1030-1050 | doc/src/reftest/autoreview.rs:1803-1826 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20–23 lines × 20) doc/src/codegen/v2/lang_ada/functions.rs:81— doc/src/codegen/v2/lang_ada/functions.rs:81-100 | doc/src/codegen/v2/lang_algol68/functions.rs:81-100 | doc/src/codegen/v2/lang_cobol/functions.rs:87-106 | doc/src/codegen/v2/lang_csharp/functions.rs:142-164 | doc/src/codegen/v2/lang_fortran/functions.rs:102-123 | doc/src/codegen/v2/lang_freebasic/functions.rs:64-83 | doc/src/codegen/v2/lang_haskell/functions.rs:430-451 | doc/src/codegen/v2/lang_java/functions.rs:175-196 | doc/src/codegen/v2/lang_julia/mod.rs:426-445 | doc/src/codegen/v2/lang_kotlin/mod.rs:199-220 | doc/src/codegen/v2/lang_lisp/functions.rs:65-84 | doc/src/codegen/v2/lang_nim/functions.rs:66-85 | doc/src/codegen/v2/lang_ocaml/functions.rs:78-99 | doc/src/codegen/v2/lang_odin/mod.rs:347-366 | doc/src/codegen/v2/lang_pascal/functions.rs:111-132 | doc/src/codegen/v2/lang_racket/functions.rs:65-84 | doc/src/codegen/v2/lang_red/mod.rs:356-375 | doc/src/codegen/v2/lang_smalltalk/functions.rs:121-140 | doc/src/codegen/v2/lang_v/mod.rs:379-398 | doc/src/codegen/v2/lang_vb6/functions.rs:79-98 — `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_pascal/functions.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 56 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6–23 lines × 14) dll/src/desktop/shell2/linux/wayland/defines.rs:1921— dll/src/desktop/shell2/linux/wayland/defines.rs:1921-1937 | dll/src/desktop/shell2/linux/wayland/defines.rs:1973-1989 | dll/src/desktop/shell2/linux/wayland/defines.rs:2025-2041 | dll/src/desktop/shell2/linux/wayland/defines.rs:2127-2143 | dll/src/desktop/shell2/linux/wayland/defines.rs:2254-2270 | dll/src/desktop/shell2/linux/wayland/defines.rs:2421-2437 | dll/src/desktop/shell2/linux/wayland/defines.rs:2533-2549 | dll/src/desktop/shell2/linux/wayland/defines.rs:2569-2585 | dll/src/desktop/shell2/linux/wayland/defines.rs:2612-2628 | dll/src/desktop/shell2/linux/wayland/defines.rs:2657-2678 | dll/src/desktop/shell2/linux/wayland/defines.rs:2860-2876 | dll/src/desktop/shell2/linux/wayland/defines.rs:2923-2945 | dll/src/desktop/shell2/linux/wayland/defines.rs:2960-2981 | dll/src/desktop/shell2/linux/wayland/defines.rs:3009-3014 — all 14 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 (21–23 lines × 5) dll/src/desktop/shell2/android/mod.rs:459— dll/src/desktop/shell2/android/mod.rs:459-479 | dll/src/desktop/shell2/headless/mod.rs:1692-1714 | dll/src/desktop/shell2/ios/mod.rs:1911-1931 | dll/src/desktop/shell2/macos/mod.rs:6017-6039 | dll/src/desktop/shell2/windows/mod.rs:1829-1851 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (23 lines × 4) webrender/core/src/batch.rs:1584— webrender/core/src/batch.rs:1584-1606 | webrender/core/src/batch.rs:1710-1732 | webrender/core/src/batch.rs:2235-2257 | webrender/core/src/batch.rs:2278-2300 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–23 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:6296— dll/src/desktop/shell2/linux/wayland/mod.rs:6296-6310 | dll/src/desktop/shell2/linux/x11/events.rs:1437-1451 | dll/src/desktop/shell2/macos/events.rs:1115-1137 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–23 lines × 2) dll/src/desktop/extra/gamepad/apple.rs:323— dll/src/desktop/extra/gamepad/apple.rs:323-336 | dll/src/desktop/extra/gamepad/apple.rs:339-361 — both copies are in the same file, so extract the 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 (22–23 lines × 2) doc/src/autofix/type_index.rs:1251— doc/src/autofix/type_index.rs:1251-1273 | doc/src/autofix/type_index.rs:3133-3154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–23 lines × 2) doc/src/codegen/v2/lang_cpp/cpp20.rs:47— doc/src/codegen/v2/lang_cpp/cpp20.rs:47-69 | doc/src/codegen/v2/lang_cpp/cpp20.rs:443-458 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–23 lines × 2) doc/src/codegen/v2/lang_java/wrappers.rs:287— doc/src/codegen/v2/lang_java/wrappers.rs:287-309 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:681-700 — `doc/src/codegen/v2/lang_java/wrappers.rs` and `doc/src/codegen/v2/lang_kotlin/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 15 separate duplicated blocks between them, totalling at least 173 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (3–23 lines × 8) doc/src/codegen/v2/config.rs:391— doc/src/codegen/v2/config.rs:391-393 | doc/src/codegen/v2/lang_crystal/mod.rs:319-321 | doc/src/codegen/v2/lang_freebasic/mod.rs:118-140 | doc/src/codegen/v2/lang_julia/mod.rs:214-216 | doc/src/codegen/v2/lang_nim/mod.rs:147-165 | doc/src/codegen/v2/lang_odin/mod.rs:148-150 | doc/src/codegen/v2/lang_pascal/mod.rs:246-248 | doc/src/codegen/v2/lang_v/mod.rs:172-174 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_julia/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 61 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18–23 lines × 2) doc/src/codegen/v2/lang_php/wrappers.rs:117— doc/src/codegen/v2/lang_php/wrappers.rs:117-139 | doc/src/codegen/v2/lang_php/wrappers.rs:236-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 (19–23 lines × 2) layout/src/cpurender/compositor.rs:2524— layout/src/cpurender/compositor.rs:2524-2542 | layout/src/cpurender/raster.rs:1421-1443 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 5) webrender/core/src/picture.rs:6382— webrender/core/src/picture.rs:6382-6404 | webrender/core/src/picture.rs:6413-6434 | webrender/core/src/picture.rs:6443-6464 | webrender/core/src/picture.rs:6473-6494 | webrender/core/src/picture.rs:6509-6530 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (22 lines × 4) layout/src/widgets/themes/flora.rs:1351— layout/src/widgets/themes/flora.rs:1351-1372 | layout/src/widgets/themes/flora.rs:1374-1395 | layout/src/widgets/themes/flora.rs:1397-1418 | layout/src/widgets/themes/flora.rs:1420-1441 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (21–22 lines × 3) dll/src/desktop/shell2/android/mod.rs:483— dll/src/desktop/shell2/android/mod.rs:483-504 | dll/src/desktop/shell2/headless/mod.rs:1717-1738 | dll/src/desktop/shell2/ios/mod.rs:1935-1955 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (22 lines × 3) layout/src/xml/svg.rs:165— layout/src/xml/svg.rs:165-186 | layout/src/xml/svg.rs:215-236 | layout/src/xml/svg.rs:662-683 — 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 (19–22 lines × 2) dll/src/desktop/shell2/linux/wayland/events.rs:823— dll/src/desktop/shell2/linux/wayland/events.rs:823-844 | dll/src/desktop/shell2/linux/wayland/events.rs:1239-1257 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–22 lines × 2) dll/src/desktop/shell2/windows/mod.rs:5804— dll/src/desktop/shell2/windows/mod.rs:5804-5819 | dll/src/desktop/shell2/windows/mod.rs:6005-6026 — both copies are in the same file, so extract the 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–22 lines × 2) dll/src/web/transpiler_remill.rs:1477— dll/src/web/transpiler_remill.rs:1477-1498 | dll/src/web/transpiler_remill.rs:6765-6776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–22 lines × 2) doc/src/codegen/v2/lang_go/wrappers.rs:160— doc/src/codegen/v2/lang_go/wrappers.rs:160-181 | doc/src/codegen/v2/lang_zig/wrappers.rs:237-254 — 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 (18–21 lines × 5) doc/src/codegen/v2/lang_cpp/cpp11.rs:67— doc/src/codegen/v2/lang_cpp/cpp11.rs:67-87 | doc/src/codegen/v2/lang_cpp/cpp14.rs:52-70 | doc/src/codegen/v2/lang_cpp/cpp17.rs:66-86 | doc/src/codegen/v2/lang_cpp/cpp20.rs:76-95 | doc/src/codegen/v2/lang_cpp/cpp20.rs:465-482 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–21 lines × 3) layout/src/cpurender/compositor.rs:2523— layout/src/cpurender/compositor.rs:2523-2539 | layout/src/cpurender/raster.rs:1420-1440 | layout/src/cpurender/raster.rs:1777-1797 — before extracting anything, compare `layout/src/cpurender/compositor.rs` and `layout/src/cpurender/raster.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20–21 lines × 3) layout/src/solver3/fc.rs:8862— layout/src/solver3/fc.rs:8862-8881 | layout/src/solver3/fc.rs:9386-9406 | layout/src/solver3/fc.rs:9592-9611 — 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 (18–21 lines × 3) layout/src/xml/mod.rs:582— layout/src/xml/mod.rs:582-599 | layout/src/xml/mod.rs:628-648 | layout/src/xml/mod.rs:680-697 — 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 (16–21 lines × 3) webrender/core/src/quad.rs:210— webrender/core/src/quad.rs:210-230 | webrender/core/src/quad.rs:464-479 | webrender/core/src/quad.rs:635-650 — 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 (18–21 lines × 2) core/src/xml.rs:8426— core/src/xml.rs:8426-8443 | core/src/xml.rs:8712-8732 — both copies are in the same file, so extract the 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–21 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:3412— dll/src/desktop/shell2/linux/wayland/mod.rs:3412-3426 | dll/src/desktop/shell2/linux/x11/mod.rs:4440-4460 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–21 lines × 2) layout/src/solver3/display_list.rs:5553— layout/src/solver3/display_list.rs:5553-5561 | layout/src/solver3/display_list.rs:5715-5735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–21 lines × 2) layout/src/widgets/node_graph.rs:3194— layout/src/widgets/node_graph.rs:3194-3214 | layout/src/widgets/node_graph.rs:3361-3377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 5) webrender/core/src/batch.rs:1590— webrender/core/src/batch.rs:1590-1609 | webrender/core/src/batch.rs:1688-1707 | webrender/core/src/batch.rs:1967-1986 | webrender/core/src/batch.rs:2241-2260 | webrender/core/src/batch.rs:2284-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.
Duplicated block (20 lines × 4) doc/src/reftest/autodoc.rs:1042— doc/src/reftest/autodoc.rs:1042-1061 | doc/src/reftest/autoreview.rs:677-696 | doc/src/reftest/autoreview.rs:913-932 | doc/src/reftest/autoreview.rs:1818-1837 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (19–20 lines × 4) layout/src/solver3/display_list.rs:4731— layout/src/solver3/display_list.rs:4731-4750 | layout/src/solver3/display_list.rs:5082-5100 | layout/src/solver3/display_list.rs:5181-5199 | layout/src/solver3/display_list.rs:5267-5285 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (20 lines × 3) webrender/core/src/batch.rs:2412— webrender/core/src/batch.rs:2412-2431 | webrender/core/src/batch.rs:2544-2563 | webrender/core/src/batch.rs:2668-2687 — 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 (17–20 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:10428— dll/src/desktop/shell2/linux/wayland/mod.rs:10428-10447 | dll/src/desktop/shell2/linux/wayland/mod.rs:10579-10595 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–20 lines × 2) layout/src/solver3/cache.rs:2004— layout/src/solver3/cache.rs:2004-2023 | layout/src/solver3/cache.rs:2162-2179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 11) dll/src/desktop/shell2/macos/mod.rs:301— dll/src/desktop/shell2/macos/mod.rs:301-319 | dll/src/desktop/shell2/macos/mod.rs:347-365 | dll/src/desktop/shell2/macos/mod.rs:376-394 | dll/src/desktop/shell2/macos/mod.rs:406-424 | dll/src/desktop/shell2/macos/mod.rs:669-687 | dll/src/desktop/shell2/macos/mod.rs:703-721 | dll/src/desktop/shell2/macos/mod.rs:733-751 | dll/src/desktop/shell2/macos/mod.rs:762-780 | dll/src/desktop/shell2/macos/mod.rs:791-809 | dll/src/desktop/shell2/macos/mod.rs:820-838 | dll/src/desktop/shell2/macos/mod.rs:880-898 — all 11 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 (14–19 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:437— doc/src/codegen/v2/lang_node/wrappers.rs:437-455 | doc/src/codegen/v2/lang_node/wrappers.rs:661-674 | doc/src/codegen/v2/lang_node/wrappers.rs:1127-1140 — 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 (13–19 lines × 3) doc/src/codegen/v2/lang_zig/wrappers.rs:731— doc/src/codegen/v2/lang_zig/wrappers.rs:731-749 | doc/src/codegen/v2/lang_zig/wrappers.rs:935-947 | doc/src/codegen/v2/lang_zig/wrappers.rs:1015-1027 — 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 (16–19 lines × 2) dll/src/desktop/shell2/common/layout.rs:953— dll/src/desktop/shell2/common/layout.rs:953-971 | layout/src/window.rs:10871-10886 — 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–19 lines × 2) dll/src/web/transpiler_remill.rs:4889— dll/src/web/transpiler_remill.rs:4889-4907 | dll/src/web/transpiler_remill.rs:4966-4979 — both copies are in the same file, so extract the 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–19 lines × 2) doc/src/codegen/v2/lang_kotlin/wrappers.rs:1557— doc/src/codegen/v2/lang_kotlin/wrappers.rs:1557-1575 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:1785-1796 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:56— doc/src/codegen/v2/lang_cpp/cpp03.rs:56-73 | doc/src/codegen/v2/lang_cpp/cpp11.rs:57-74 | doc/src/codegen/v2/lang_cpp/cpp14.rs:43-59 | doc/src/codegen/v2/lang_cpp/cpp17.rs:56-73 | doc/src/codegen/v2/lang_cpp/cpp20.rs:66-83 | doc/src/codegen/v2/lang_cpp/cpp20.rs:455-472 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 5) layout/src/dialogs/crash_reporter.rs:201— layout/src/dialogs/crash_reporter.rs:201-218 | layout/src/dialogs/gpu_check.rs:215-232 | layout/src/dialogs/report_problem.rs:470-487 | layout/src/dialogs/telemetry_consent.rs:203-220 | layout/src/dialogs/update_version.rs:321-338 — before extracting anything, compare `layout/src/dialogs/crash_reporter.rs` and `layout/src/dialogs/report_problem.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 4) doc/src/codegen/v2/lang_cpp/cpp03.rs:555— doc/src/codegen/v2/lang_cpp/cpp03.rs:555-572 | doc/src/codegen/v2/lang_cpp/cpp11.rs:475-492 | doc/src/codegen/v2/lang_cpp/cpp17.rs:664-681 | doc/src/codegen/v2/lang_cpp/cpp20.rs:363-380 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (1–18 lines × 5) core/src/events.rs:1747— core/src/events.rs:1747-1764 | core/src/events.rs:1890-1907 | core/src/events.rs:2049-2066 | core/src/window.rs:2585-2585 | layout/src/text3/default.rs:660-663 — there are 5 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 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10–18 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3419— dll/src/desktop/shell2/linux/wayland/mod.rs:3419-3428 | dll/src/desktop/shell2/linux/wayland/mod.rs:3726-3735 | dll/src/desktop/shell2/linux/x11/mod.rs:4445-4462 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–18 lines × 3) doc/src/codegen/v2/lang_cpp/cpp11.rs:38— doc/src/codegen/v2/lang_cpp/cpp11.rs:38-55 | doc/src/codegen/v2/lang_cpp/cpp14.rs:32-40 | doc/src/codegen/v2/lang_cpp/cpp17.rs:37-54 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp11.rs` and `doc/src/codegen/v2/lang_cpp/cpp14.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 164 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–18 lines × 2) dll/src/desktop/extra/pdf/mod.rs:504— dll/src/desktop/extra/pdf/mod.rs:504-516 | dll/src/desktop/extra/pdf/mod.rs:529-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–17 lines × 3) layout/src/solver3/fc.rs:8950— layout/src/solver3/fc.rs:8950-8962 | layout/src/solver3/fc.rs:9500-9512 | layout/src/solver3/fc.rs:9997-10013 — 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 (14–17 lines × 3) layout/src/text3/edit.rs:557— layout/src/text3/edit.rs:557-573 | layout/src/text3/edit.rs:822-835 | layout/src/text3/edit.rs:955-968 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–17 lines × 2) dll/src/desktop/shell2/common/layout.rs:711— dll/src/desktop/shell2/common/layout.rs:711-722 | dll/src/desktop/shell2/common/layout.rs:1358-1374 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 8) layout/src/xml/svg.rs:887— layout/src/xml/svg.rs:887-902 | layout/src/xml/svg.rs:926-941 | layout/src/xml/svg.rs:994-1009 | layout/src/xml/svg.rs:1060-1075 | layout/src/xml/svg.rs:1137-1152 | layout/src/xml/svg.rs:1193-1208 | layout/src/xml/svg.rs:1241-1256 | layout/src/xml/svg.rs:1291-1306 — all 8 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 (14–16 lines × 5) dll/src/desktop/shell2/android/mod.rs:452— dll/src/desktop/shell2/android/mod.rs:452-465 | dll/src/desktop/shell2/ios/mod.rs:1904-1917 | dll/src/desktop/shell2/linux/wayland/mod.rs:6448-6463 | dll/src/desktop/shell2/linux/x11/mod.rs:6176-6191 | dll/src/desktop/shell2/windows/mod.rs:1821-1836 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (16 lines × 5) layout/src/xml/svg.rs:710— layout/src/xml/svg.rs:710-725 | layout/src/xml/svg.rs:748-763 | layout/src/xml/svg.rs:961-976 | layout/src/xml/svg.rs:1026-1041 | layout/src/xml/svg.rs:1104-1119 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–16 lines × 4) layout/src/solver3/fc.rs:1629— layout/src/solver3/fc.rs:1629-1643 | layout/src/solver3/fc.rs:1703-1717 | layout/src/solver3/fc.rs:2449-2464 | layout/src/solver3/fc.rs:2535-2550 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–16 lines × 3) dll/src/desktop/shell2/windows/mod.rs:1879— dll/src/desktop/shell2/windows/mod.rs:1879-1894 | dll/src/desktop/shell2/windows/mod.rs:1946-1961 | dll/src/desktop/shell2/windows/mod.rs:7050-7064 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–16 lines × 2) dll/src/desktop/shell2/linux/wayland/mod.rs:5678— dll/src/desktop/shell2/linux/wayland/mod.rs:5678-5693 | dll/src/desktop/shell2/linux/wayland/mod.rs:5856-5867 — both copies are in the same file, so extract the 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–16 lines × 2) doc/src/codegen/v2/lang_csharp/wrappers.rs:1516— doc/src/codegen/v2/lang_csharp/wrappers.rs:1516-1526 | doc/src/codegen/v2/lang_java/wrappers.rs:1425-1440 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (4–16 lines × 3) doc/src/codegen/v2/lang_crystal/wrappers.rs:1087— doc/src/codegen/v2/lang_crystal/wrappers.rs:1087-1090 | doc/src/codegen/v2/lang_d/wrappers.rs:1793-1808 | doc/src/codegen/v2/lang_swift/wrappers.rs:1770-1785 — `doc/src/codegen/v2/lang_crystal/wrappers.rs` and `doc/src/codegen/v2/lang_d/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 6 separate duplicated blocks between them, totalling at least 51 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–15 lines × 6) webrender/core/src/device/gl.rs:3662— webrender/core/src/device/gl.rs:3662-3674 | webrender/core/src/device/gl.rs:3685-3697 | webrender/core/src/device/gl.rs:3708-3720 | webrender/core/src/device/gl.rs:3726-3738 | webrender/core/src/device/gl.rs:3744-3758 | webrender/core/src/device/gl.rs:3763-3775 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–15 lines × 5) dll/src/desktop/shell2/android/mod.rs:474— dll/src/desktop/shell2/android/mod.rs:474-487 | dll/src/desktop/shell2/ios/mod.rs:1926-1939 | dll/src/desktop/shell2/linux/wayland/mod.rs:6472-6486 | dll/src/desktop/shell2/linux/x11/mod.rs:6200-6214 | dll/src/desktop/shell2/windows/mod.rs:1845-1859 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/ios/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 17 separate duplicated blocks between them, totalling at least 215 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–15 lines × 4) webrender/core/src/batch.rs:1581— webrender/core/src/batch.rs:1581-1595 | webrender/core/src/batch.rs:2234-2246 | webrender/core/src/batch.rs:2277-2289 | webrender/core/src/batch.rs:3300-3312 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–15 lines × 3) css/src/dynamic_selector.rs:1454— css/src/dynamic_selector.rs:1454-1465 | css/src/parser2.rs:1401-1412 | css/src/parser2.rs:1424-1438 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13–15 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:3572— dll/src/desktop/shell2/linux/wayland/mod.rs:3572-3584 | dll/src/desktop/shell2/linux/wayland/mod.rs:3672-3686 | dll/src/desktop/shell2/linux/wayland/mod.rs:5377-5390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–14 lines × 5) dll/src/desktop/shell2/windows/mod.rs:4660— dll/src/desktop/shell2/windows/mod.rs:4660-4671 | dll/src/desktop/shell2/windows/mod.rs:5009-5022 | dll/src/desktop/shell2/windows/mod.rs:5105-5118 | dll/src/desktop/shell2/windows/mod.rs:5155-5168 | dll/src/desktop/shell2/windows/mod.rs:5239-5251 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 5) layout/src/widgets/breadcrumb.rs:337— layout/src/widgets/breadcrumb.rs:337-350 | layout/src/widgets/pagination.rs:501-514 | layout/src/widgets/radio_group.rs:546-559 | layout/src/widgets/segmented.rs:444-457 | layout/src/widgets/stepper.rs:568-581 — before extracting anything, compare `layout/src/widgets/pagination.rs` and `layout/src/widgets/segmented.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–14 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:7212— dll/src/desktop/shell2/linux/wayland/mod.rs:7212-7225 | dll/src/desktop/shell2/linux/x11/mod.rs:6947-6960 | dll/src/desktop/shell2/windows/mod.rs:1659-1669 — `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 45 separate duplicated blocks between them, totalling at least 685 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13–14 lines × 3) doc/src/autofix/type_index.rs:2057— doc/src/autofix/type_index.rs:2057-2070 | doc/src/autofix/type_index.rs:2076-2088 | doc/src/autofix/type_index.rs:2216-2228 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–14 lines × 3) layout/src/solver3/display_list.rs:1230— layout/src/solver3/display_list.rs:1230-1243 | layout/src/solver3/display_list.rs:1345-1358 | layout/src/solver3/display_list.rs:1370-1381 — 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–14 lines × 2) core/src/compact.rs:417— core/src/compact.rs:417-426 | core/src/compact.rs:1713-1726 — both copies are in the same file, so extract the 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–14 lines × 2) dll/src/web/transpiler_remill.rs:11838— dll/src/web/transpiler_remill.rs:11838-11851 | dll/src/web/transpiler_remill.rs:11867-11875 — both copies are in the same file, so extract the 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 (4–14 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:486— doc/src/codegen/v2/lang_crystal/model.rs:486-499 | doc/src/codegen/v2/lang_d/model.rs:782-795 | doc/src/codegen/v2/lang_swift/model.rs:792-795 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 9) doc/src/codegen/v2/lang_csharp/mod.rs:288— doc/src/codegen/v2/lang_csharp/mod.rs:288-300 | doc/src/codegen/v2/lang_freebasic/mod.rs:330-342 | doc/src/codegen/v2/lang_go/mod.rs:412-424 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2364-2376 | doc/src/codegen/v2/lang_nim/mod.rs:378-390 | doc/src/codegen/v2/lang_ocaml/mod.rs:1024-1036 | doc/src/codegen/v2/lang_pascal/mod.rs:508-520 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:437-449 | doc/src/codegen/v2/lang_vb6/mod.rs:395-407 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 7) doc/src/autofix/patch_format.rs:14— doc/src/autofix/patch_format.rs:14-26 | doc/src/autofix/workspace.rs:2238-2250 | doc/src/codegen/v2/ir.rs:504-516 | doc/src/codegen/v2/ir_builder.rs:2680-2692 | doc/src/codegen/v2/lang_python.rs:4556-4568 | doc/src/codegen/v2/lang_rust.rs:5004-5016 | doc/src/codegen/v2/transmute_helpers.rs:507-519 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
Duplicated block (13 lines × 6) dll/src/desktop/shell2/android/mod.rs:458— dll/src/desktop/shell2/android/mod.rs:458-470 | dll/src/desktop/shell2/headless/mod.rs:1691-1704 | dll/src/desktop/shell2/ios/mod.rs:1910-1922 | dll/src/desktop/shell2/linux/x11/mod.rs:6183-6196 | dll/src/desktop/shell2/macos/mod.rs:6016-6029 | dll/src/desktop/shell2/windows/mod.rs:1828-1841 — `dll/src/desktop/shell2/android/mod.rs` and `dll/src/desktop/shell2/headless/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 5) layout/src/solver3/fc.rs:1612— layout/src/solver3/fc.rs:1612-1624 | layout/src/solver3/fc.rs:1686-1698 | layout/src/solver3/fc.rs:1830-1842 | layout/src/solver3/fc.rs:2431-2443 | layout/src/solver3/fc.rs:2471-2483 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 4) doc/src/codegen/v2/lang_rust.rs:2523— doc/src/codegen/v2/lang_rust.rs:2523-2535 | doc/src/codegen/v2/lang_rust.rs:2598-2610 | doc/src/codegen/v2/rust/shared.rs:132-144 | doc/src/codegen/v2/rust/shared.rs:181-193 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–13 lines × 3) doc/src/codegen/v2/lang_d/types.rs:188— doc/src/codegen/v2/lang_d/types.rs:188-196 | doc/src/codegen/v2/lang_odin/types.rs:236-248 | doc/src/codegen/v2/lang_v/types.rs:244-256 — `doc/src/codegen/v2/lang_d/types.rs` and `doc/src/codegen/v2/lang_odin/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 15) css/src/system.rs:2250— css/src/system.rs:2250-2261 | css/src/system.rs:2302-2313 | css/src/system.rs:2354-2365 | css/src/system.rs:2406-2417 | css/src/system.rs:2459-2470 | css/src/system.rs:2517-2528 | css/src/system.rs:2566-2577 | css/src/system.rs:2618-2629 | css/src/system.rs:2668-2679 | css/src/system.rs:2717-2728 | css/src/system.rs:2795-2806 | css/src/system.rs:2873-2884 | css/src/system.rs:2924-2935 | css/src/system.rs:2973-2984 | css/src/system.rs:3020-3031 — all 15 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 10) doc/src/codegen/v2/lang_csharp/mod.rs:287— doc/src/codegen/v2/lang_csharp/mod.rs:287-298 | doc/src/codegen/v2/lang_freebasic/mod.rs:329-340 | doc/src/codegen/v2/lang_go/mod.rs:411-422 | doc/src/codegen/v2/lang_haskell/wrappers.rs:2363-2374 | doc/src/codegen/v2/lang_nim/mod.rs:377-388 | doc/src/codegen/v2/lang_ocaml/mod.rs:1023-1034 | doc/src/codegen/v2/lang_pascal/mod.rs:507-518 | doc/src/codegen/v2/lang_powershell/cmdlets.rs:370-381 | doc/src/codegen/v2/lang_smalltalk/wrappers.rs:436-447 | doc/src/codegen/v2/lang_vb6/mod.rs:394-405 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 6) doc/src/autofix/type_index.rs:2485— doc/src/autofix/type_index.rs:2485-2496 | doc/src/autofix/type_index.rs:2526-2537 | doc/src/autofix/type_index.rs:2567-2578 | doc/src/autofix/type_index.rs:2608-2619 | doc/src/autofix/type_index.rs:2659-2670 | doc/src/autofix/type_index.rs:2798-2809 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:306— doc/src/codegen/v2/lang_cpp/cpp03.rs:306-314 | doc/src/codegen/v2/lang_cpp/cpp11.rs:205-213 | doc/src/codegen/v2/lang_cpp/cpp11.rs:283-294 | doc/src/codegen/v2/lang_cpp/cpp17.rs:353-361 | doc/src/codegen/v2/lang_cpp/cpp17.rs:440-451 | doc/src/codegen/v2/lang_cpp/cpp20.rs:1049-1057 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–12 lines × 6) doc/src/codegen/v2/lang_java/derives.rs:682— doc/src/codegen/v2/lang_java/derives.rs:682-689 | doc/src/codegen/v2/lang_java/functions.rs:244-255 | doc/src/codegen/v2/lang_java/types.rs:432-438 | doc/src/codegen/v2/lang_java/types.rs:744-754 | doc/src/codegen/v2/lang_java/types.rs:927-935 | doc/src/codegen/v2/lang_java/wrappers.rs:1941-1947 — there are 6 copies across 4 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.
Duplicated block (12 lines × 5) layout/src/widgets/quick_access.rs:290— layout/src/widgets/quick_access.rs:290-301 | layout/src/widgets/ribbon.rs:587-598 | layout/src/widgets/ribbon.rs:1282-1293 | layout/src/widgets/statusbar.rs:313-324 | layout/src/widgets/statusbar.rs:553-564 — before extracting anything, compare `layout/src/widgets/quick_access.rs` and `layout/src/widgets/ribbon.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11–12 lines × 4) doc/src/reftest/autodoc.rs:995— doc/src/reftest/autodoc.rs:995-1005 | doc/src/reftest/autoreview.rs:615-625 | doc/src/reftest/autoreview.rs:844-855 | doc/src/reftest/autoreview.rs:1768-1778 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–12 lines × 3) dll/src/desktop/shell2/linux/wayland/mod.rs:4668— dll/src/desktop/shell2/linux/wayland/mod.rs:4668-4675 | dll/src/desktop/shell2/linux/wayland/mod.rs:5720-5730 | dll/src/desktop/shell2/linux/wayland/mod.rs:5878-5889 — 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–12 lines × 3) doc/src/reftest/autodoc.rs:932— doc/src/reftest/autodoc.rs:932-942 | doc/src/reftest/autoreview.rs:1142-1153 | doc/src/reftest/autoreview.rs:1581-1592 — before extracting anything, compare `doc/src/reftest/autodoc.rs` and `doc/src/reftest/autoreview.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 207 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–12 lines × 3) doc/src/codegen/v2/lang_csharp/types.rs:453— doc/src/codegen/v2/lang_csharp/types.rs:453-463 | doc/src/codegen/v2/lang_kotlin/mod.rs:519-530 | doc/src/codegen/v2/lang_ruby/types.rs:691-693 — before extracting anything, compare `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_kotlin/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:327— doc/src/codegen/v2/lang_cpp/cpp03.rs:327-340 | doc/src/codegen/v2/lang_cpp/cpp03.rs:690-700 | doc/src/codegen/v2/lang_cpp/cpp11.rs:234-247 | doc/src/codegen/v2/lang_cpp/cpp11.rs:612-622 | doc/src/codegen/v2/lang_cpp/cpp17.rs:391-404 | doc/src/codegen/v2/lang_cpp/cpp17.rs:822-832 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–11 lines × 4) dll/src/desktop/shell2/linux/wayland/mod.rs:6277— dll/src/desktop/shell2/linux/wayland/mod.rs:6277-6283 | dll/src/desktop/shell2/linux/x11/events.rs:1418-1424 | dll/src/desktop/shell2/macos/events.rs:1182-1192 | dll/src/desktop/shell2/windows/mod.rs:2179-2187 — before extracting anything, compare `dll/src/desktop/shell2/linux/wayland/mod.rs` and `dll/src/desktop/shell2/linux/x11/events.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 249 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8–11 lines × 3) doc/src/codegen/v2/lang_node/wrappers.rs:570— doc/src/codegen/v2/lang_node/wrappers.rs:570-577 | doc/src/codegen/v2/lang_node/wrappers.rs:743-753 | doc/src/codegen/v2/lang_node/wrappers.rs:1226-1236 — 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 × 7) dll/src/desktop/shell2/windows/mod.rs:4666— dll/src/desktop/shell2/windows/mod.rs:4666-4675 | dll/src/desktop/shell2/windows/mod.rs:4876-4885 | dll/src/desktop/shell2/windows/mod.rs:5017-5026 | dll/src/desktop/shell2/windows/mod.rs:5113-5122 | dll/src/desktop/shell2/windows/mod.rs:5163-5172 | dll/src/desktop/shell2/windows/mod.rs:5218-5227 | dll/src/desktop/shell2/windows/mod.rs:5246-5255 — 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.
Duplicated block (10 lines × 6) doc/src/codegen/v2/lang_cpp/cpp03.rs:259— doc/src/codegen/v2/lang_cpp/cpp03.rs:259-268 | doc/src/codegen/v2/lang_cpp/cpp03.rs:296-305 | doc/src/codegen/v2/lang_cpp/cpp11.rs:168-177 | doc/src/codegen/v2/lang_cpp/cpp11.rs:195-204 | doc/src/codegen/v2/lang_cpp/cpp17.rs:299-308 | doc/src/codegen/v2/lang_cpp/cpp17.rs:343-352 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–10 lines × 4) doc/src/codegen/v2/lang_freebasic/mod.rs:173— doc/src/codegen/v2/lang_freebasic/mod.rs:173-180 | doc/src/codegen/v2/lang_nim/mod.rs:200-207 | doc/src/codegen/v2/lang_smalltalk/mod.rs:183-192 | doc/src/codegen/v2/lang_vb6/mod.rs:249-256 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (4–10 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:73— doc/src/codegen/v2/lang_csharp/wrappers.rs:73-80 | doc/src/codegen/v2/lang_java/wrappers.rs:1229-1238 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:70-77 | doc/src/codegen/v2/lang_node/wrappers.rs:1289-1292 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9–10 lines × 3) layout/src/font.rs:1867— layout/src/font.rs:1867-1876 | layout/src/font.rs:1888-1896 | layout/src/font.rs:1954-1962 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–10 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:83— doc/src/codegen/v2/lang_csharp/wrappers.rs:83-92 | doc/src/codegen/v2/lang_java/wrappers.rs:1240-1243 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:80-89 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (3–10 lines × 3) doc/src/codegen/v2/lang_csharp/wrappers.rs:110— doc/src/codegen/v2/lang_csharp/wrappers.rs:110-119 | doc/src/codegen/v2/lang_java/wrappers.rs:1268-1270 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:107-116 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–9 lines × 11) doc/src/autofix/type_index.rs:2024— doc/src/autofix/type_index.rs:2024-2032 | doc/src/autofix/type_index.rs:2265-2271 | doc/src/autofix/type_index.rs:2312-2318 | doc/src/autofix/type_index.rs:2413-2419 | doc/src/autofix/type_index.rs:2462-2468 | doc/src/autofix/type_index.rs:2503-2509 | doc/src/autofix/type_index.rs:2544-2550 | doc/src/autofix/type_index.rs:2585-2591 | doc/src/autofix/type_index.rs:2628-2634 | doc/src/autofix/type_index.rs:2679-2685 | doc/src/autofix/type_index.rs:2767-2773 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 8) doc/src/codegen/v2/lang_rust.rs:2520— doc/src/codegen/v2/lang_rust.rs:2520-2528 | doc/src/codegen/v2/lang_rust.rs:2595-2603 | doc/src/codegen/v2/rust/dynamic_binding.rs:150-157 | doc/src/codegen/v2/rust/dynamic_binding.rs:279-286 | doc/src/codegen/v2/rust/shared.rs:129-137 | doc/src/codegen/v2/rust/shared.rs:178-186 | doc/src/codegen/v2/rust/static_binding.rs:236-244 | doc/src/codegen/v2/rust/static_binding.rs:304-311 — before extracting anything, compare `doc/src/codegen/v2/lang_rust.rs` and `doc/src/codegen/v2/rust/shared.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 200 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 7) doc/src/codegen/v2/lang_cpp/cpp03.rs:333— doc/src/codegen/v2/lang_cpp/cpp03.rs:333-341 | doc/src/codegen/v2/lang_cpp/cpp03.rs:693-701 | doc/src/codegen/v2/lang_cpp/cpp11.rs:240-248 | doc/src/codegen/v2/lang_cpp/cpp11.rs:615-623 | doc/src/codegen/v2/lang_cpp/cpp17.rs:397-405 | doc/src/codegen/v2/lang_cpp/cpp17.rs:825-833 | doc/src/codegen/v2/lang_cpp/cpp20.rs:949-957 — before extracting anything, compare `doc/src/codegen/v2/lang_cpp/cpp03.rs` and `doc/src/codegen/v2/lang_cpp/cpp11.rs` as WHOLE FILES: this scan already matched 28 separate duplicated blocks between them, totalling at least 483 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 5) layout/src/cpurender/compositor.rs:436— layout/src/cpurender/compositor.rs:436-444 | layout/src/cpurender/compositor.rs:477-484 | layout/src/cpurender/compositor.rs:513-520 | layout/src/cpurender/compositor.rs:575-582 | layout/src/cpurender/compositor.rs:623-630 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–9 lines × 4) doc/src/codegen/v2/lang_freebasic/types.rs:165— doc/src/codegen/v2/lang_freebasic/types.rs:165-173 | doc/src/codegen/v2/lang_freebasic/types.rs:192-199 | doc/src/codegen/v2/lang_vb6/types.rs:183-191 | doc/src/codegen/v2/lang_vb6/types.rs:228-235 — `doc/src/codegen/v2/lang_freebasic/types.rs` and `doc/src/codegen/v2/lang_vb6/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 8 separate duplicated blocks between them, totalling at least 109 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–9 lines × 3) doc/src/codegen/v2/lang_freebasic/functions.rs:123— doc/src/codegen/v2/lang_freebasic/functions.rs:123-131 | doc/src/codegen/v2/lang_freebasic/types.rs:368-374 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:434-440 — before extracting anything, compare `doc/src/codegen/v2/lang_freebasic/functions.rs` and `doc/src/codegen/v2/lang_freebasic/types.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5–9 lines × 3) layout/src/image.rs:643— layout/src/image.rs:643-651 | layout/src/image.rs:692-696 | layout/src/image.rs:732-736 — 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 (1–9 lines × 3) doc/src/codegen/v2/lang_crystal/model.rs:554— doc/src/codegen/v2/lang_crystal/model.rs:554-562 | doc/src/codegen/v2/lang_d/model.rs:860-868 | doc/src/codegen/v2/lang_swift/model.rs:861-861 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_d/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 74 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 16) dll/src/desktop/shell2/linux/wayland/defines.rs:752— dll/src/desktop/shell2/linux/wayland/defines.rs:752-758 | dll/src/desktop/shell2/linux/wayland/defines.rs:793-799 | dll/src/desktop/shell2/linux/wayland/defines.rs:840-846 | dll/src/desktop/shell2/linux/wayland/defines.rs:881-887 | dll/src/desktop/shell2/linux/wayland/defines.rs:933-939 | dll/src/desktop/shell2/linux/wayland/defines.rs:1000-1006 | dll/src/desktop/shell2/linux/wayland/defines.rs:1078-1084 | dll/src/desktop/shell2/linux/wayland/defines.rs:1116-1122 | dll/src/desktop/shell2/linux/wayland/defines.rs:1157-1163 | dll/src/desktop/shell2/linux/wayland/defines.rs:1199-1205 | dll/src/desktop/shell2/linux/wayland/defines.rs:1251-1257 | dll/src/desktop/shell2/linux/wayland/defines.rs:1308-1314 | dll/src/desktop/shell2/linux/wayland/defines.rs:1365-1371 | dll/src/desktop/shell2/linux/wayland/defines.rs:1484-1490 | dll/src/desktop/shell2/linux/wayland/defines.rs:1538-1545 | dll/src/desktop/shell2/linux/wayland/defines.rs:1642-1648 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 15) css/src/system.rs:2230— css/src/system.rs:2230-2236 | css/src/system.rs:2282-2288 | css/src/system.rs:2334-2340 | css/src/system.rs:2386-2392 | css/src/system.rs:2441-2447 | css/src/system.rs:2499-2505 | css/src/system.rs:2548-2554 | css/src/system.rs:2598-2604 | css/src/system.rs:2648-2654 | css/src/system.rs:2697-2703 | css/src/system.rs:2776-2783 | css/src/system.rs:2849-2855 | css/src/system.rs:2904-2910 | css/src/system.rs:2953-2959 | css/src/system.rs:3002-3008 — all 15 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–8 lines × 11) doc/src/codegen/v2/lang_ada/mod.rs:222— doc/src/codegen/v2/lang_ada/mod.rs:222-227 | doc/src/codegen/v2/lang_algol68/mod.rs:381-386 | doc/src/codegen/v2/lang_cobol/types.rs:560-565 | doc/src/codegen/v2/lang_freebasic/mod.rs:173-178 | doc/src/codegen/v2/lang_haskell/types.rs:1115-1120 | doc/src/codegen/v2/lang_nim/mod.rs:200-205 | doc/src/codegen/v2/lang_nim/mod.rs:223-228 | doc/src/codegen/v2/lang_ocaml/mod.rs:933-938 | doc/src/codegen/v2/lang_pascal/mod.rs:294-299 | doc/src/codegen/v2/lang_smalltalk/mod.rs:183-190 | doc/src/codegen/v2/lang_vb6/mod.rs:249-254 — `doc/src/codegen/v2/lang_freebasic/mod.rs` and `doc/src/codegen/v2/lang_nim/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 5 separate duplicated blocks between them, totalling at least 66 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7–8 lines × 4) dll/src/desktop/shell2/linux/x11/mod.rs:5922— dll/src/desktop/shell2/linux/x11/mod.rs:5922-5929 | dll/src/desktop/shell2/linux/x11/mod.rs:5962-5969 | dll/src/desktop/shell2/linux/x11/mod.rs:7382-7388 | dll/src/desktop/shell2/linux/x11/mod.rs:8440-8446 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5–8 lines × 4) doc/src/autofix/mod.rs:3145— doc/src/autofix/mod.rs:3145-3149 | doc/src/autofix/mod.rs:3168-3175 | doc/src/autofix/mod.rs:3198-3205 | doc/src/autofix/mod.rs:3227-3234 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) dll/src/desktop/shell2/android/mod.rs:2393— dll/src/desktop/shell2/android/mod.rs:2393-2399 | dll/src/desktop/shell2/android/mod.rs:2455-2461 | dll/src/desktop/shell2/android/mod.rs:3110-3117 — 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–8 lines × 2) doc/src/codegen/v2/lang_crystal/model.rs:302— doc/src/codegen/v2/lang_crystal/model.rs:302-307 | doc/src/codegen/v2/lang_swift/model.rs:374-381 — `doc/src/codegen/v2/lang_crystal/model.rs` and `doc/src/codegen/v2/lang_swift/model.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 10 separate duplicated blocks between them, totalling at least 85 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 6) doc/src/codegen/v2/lang_ada/types.rs:562— doc/src/codegen/v2/lang_ada/types.rs:562-568 | doc/src/codegen/v2/lang_csharp/types.rs:800-806 | doc/src/codegen/v2/lang_java/types.rs:1048-1054 | doc/src/codegen/v2/lang_kotlin/mod.rs:1268-1274 | doc/src/codegen/v2/lang_ocaml/types.rs:964-970 | doc/src/codegen/v2/lang_smalltalk/types.rs:411-417 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_smalltalk/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 34 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (2–7 lines × 4) doc/src/codegen/v2/lang_csharp/wrappers.rs:114— doc/src/codegen/v2/lang_csharp/wrappers.rs:114-120 | doc/src/codegen/v2/lang_java/wrappers.rs:1274-1280 | doc/src/codegen/v2/lang_kotlin/wrappers.rs:111-117 | doc/src/codegen/v2/lang_node/wrappers.rs:1336-1337 — `doc/src/codegen/v2/lang_csharp/wrappers.rs` and `doc/src/codegen/v2/lang_java/wrappers.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 14 separate duplicated blocks between them, totalling at least 156 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 12) css/src/props/basic/color.rs:902— css/src/props/basic/color.rs:902-907 | css/src/props/basic/color.rs:914-919 | css/src/props/basic/color.rs:926-931 | css/src/props/basic/color.rs:938-943 | css/src/props/basic/color.rs:950-955 | css/src/props/basic/color.rs:962-967 | css/src/props/basic/color.rs:974-979 | css/src/props/basic/color.rs:986-991 | css/src/props/basic/color.rs:998-1003 | css/src/props/basic/color.rs:1010-1015 | css/src/props/basic/color.rs:1022-1027 | css/src/props/basic/color.rs:1034-1039 — all 12 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 × 6) dll/src/desktop/shell2/linux/wayland/screencopy.rs:67— dll/src/desktop/shell2/linux/wayland/screencopy.rs:67-72 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:95-100 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:133-138 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:173-178 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:245-250 | dll/src/desktop/shell2/linux/wayland/screencopy.rs:316-321 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–6 lines × 6) dll/src/desktop/extra/camera/windows.rs:453— dll/src/desktop/extra/camera/windows.rs:453-458 | dll/src/desktop/extra/capture_slot.rs:127-132 | dll/src/desktop/extra/screencap/windows.rs:361-366 | layout/src/cpurender/raster.rs:4623-4626 | layout/src/cpurender/raster.rs:4632-4637 | layout/src/cpurender/raster.rs:4640-4645 — there are 6 copies across 4 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.
Duplicated block (3–6 lines × 6) css/src/system.rs:2214— css/src/system.rs:2214-2219 | css/src/system.rs:2268-2271 | css/src/system.rs:2318-2323 | css/src/system.rs:2370-2375 | css/src/system.rs:2429-2431 | css/src/system.rs:2480-2482 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–6 lines × 4) layout/src/cpurender/pixmap.rs:119— layout/src/cpurender/pixmap.rs:119-124 | layout/src/cpurender/pixmap.rs:303-308 | layout/src/cpurender/pixmap.rs:484-489 | layout/src/cpurender/raster.rs:4684-4687 — 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.
Duplicated block (5 lines × 9) layout/src/callbacks.rs:3460— layout/src/callbacks.rs:3460-3464 | layout/src/callbacks.rs:3485-3489 | layout/src/callbacks.rs:3510-3514 | layout/src/callbacks.rs:3535-3539 | layout/src/callbacks.rs:3560-3564 | layout/src/callbacks.rs:3586-3590 | layout/src/callbacks.rs:3637-3641 | layout/src/callbacks.rs:3656-3660 | layout/src/callbacks.rs:3788-3792 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–5 lines × 3) dll/src/desktop/shell2/linux/system_style.rs:771— dll/src/desktop/shell2/linux/system_style.rs:771-775 | dll/src/desktop/shell2/linux/system_style.rs:1468-1472 | dll/src/desktop/shell2/linux/system_style.rs:1579-1581 — 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 (15 lines × 20) doc/src/codegen/v2/lang_ada/types.rs:200— doc/src/codegen/v2/lang_ada/types.rs:200-214 | doc/src/codegen/v2/lang_ada/wrappers.rs:85-99 | doc/src/codegen/v2/lang_algol68/types.rs:101-115 | doc/src/codegen/v2/lang_algol68/types.rs:117-131 | doc/src/codegen/v2/lang_algol68/wrappers.rs:133-147 | doc/src/codegen/v2/lang_cobol/types.rs:37-51 | doc/src/codegen/v2/lang_cobol/types.rs:53-67 | doc/src/codegen/v2/lang_cobol/wrappers.rs:101-115 | doc/src/codegen/v2/lang_fortran/types.rs:321-335 | doc/src/codegen/v2/lang_fortran/types.rs:337-351 | doc/src/codegen/v2/lang_fortran/wrappers.rs:496-510 | doc/src/codegen/v2/lang_freebasic/types.rs:97-111 | doc/src/codegen/v2/lang_freebasic/types.rs:113-127 | doc/src/codegen/v2/lang_freebasic/wrappers.rs:99-113 | doc/src/codegen/v2/lang_ocaml/wrappers.rs:235-249 | doc/src/codegen/v2/lang_pascal/wrappers.rs:149-163 | doc/src/codegen/v2/lang_smalltalk/types.rs:83-97 | doc/src/codegen/v2/lang_vb6/types.rs:114-128 | doc/src/codegen/v2/lang_vb6/types.rs:130-144 | doc/src/codegen/v2/lang_vb6/wrappers.rs:76-90 — `doc/src/codegen/v2/lang_ada/types.rs` and `doc/src/codegen/v2/lang_cobol/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 48 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 20) doc/src/codegen/v2/lang_csharp/types.rs:243— doc/src/codegen/v2/lang_csharp/types.rs:243-255 | doc/src/codegen/v2/lang_csharp/types.rs:257-268 | doc/src/codegen/v2/lang_java/types.rs:389-403 | doc/src/codegen/v2/lang_java/types.rs:405-420 | doc/src/codegen/v2/lang_julia/mod.rs:380-391 | doc/src/codegen/v2/lang_julia/mod.rs:393-404 | doc/src/codegen/v2/lang_kotlin/mod.rs:154-167 | doc/src/codegen/v2/lang_kotlin/mod.rs:169-180 | doc/src/codegen/v2/lang_lisp/types.rs:119-132 | doc/src/codegen/v2/lang_lisp/types.rs:134-145 | doc/src/codegen/v2/lang_odin/mod.rs:301-312 | doc/src/codegen/v2/lang_odin/mod.rs:314-325 | doc/src/codegen/v2/lang_pascal/types.rs:217-233 | doc/src/codegen/v2/lang_pascal/types.rs:235-246 | doc/src/codegen/v2/lang_racket/types.rs:112-123 | doc/src/codegen/v2/lang_racket/types.rs:125-136 | doc/src/codegen/v2/lang_ruby/types.rs:375-389 | doc/src/codegen/v2/lang_ruby/types.rs:391-405 | doc/src/codegen/v2/lang_v/mod.rs:333-344 | doc/src/codegen/v2/lang_v/mod.rs:346-357 — `doc/src/codegen/v2/lang_csharp/types.rs` and `doc/src/codegen/v2/lang_java/types.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 40 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 7) layout/src/widgets/alert.rs:468— layout/src/widgets/alert.rs:468-472 | layout/src/widgets/avatar.rs:291-295 | layout/src/widgets/badge.rs:268-272 | layout/src/widgets/button.rs:547-551 | layout/src/widgets/chip.rs:455-459 | layout/src/widgets/label.rs:121-125 | layout/src/widgets/toast.rs:497-501 — before extracting anything, compare `layout/src/widgets/alert.rs` and `layout/src/widgets/toast.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 122 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 7) webrender/api/src/display_item.rs:69— webrender/api/src/display_item.rs:69-75 | webrender/api/src/display_item.rs:973-979 | webrender/api/src/font.rs:236-242 | webrender/api/src/lib.rs:636-642 | webrender/api/src/lib.rs:728-734 | webrender/core/src/clip.rs:872-878 | webrender/core/src/gpu_types.rs:619-625 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 23) css/src/props/layout/display.rs:214— css/src/props/layout/display.rs:214-220 | css/src/props/layout/display.rs:293-299 | css/src/props/layout/flex.rs:327-333 | css/src/props/layout/flex.rs:498-504 | css/src/props/layout/flex.rs:589-595 | css/src/props/layout/flex.rs:677-683 | css/src/props/layout/flex.rs:784-790 | css/src/props/layout/fragmentation.rs:225-231 | css/src/props/layout/fragmentation.rs:286-292 | css/src/props/layout/fragmentation.rs:412-418 | css/src/props/style/effects.rs:730-736 | css/src/props/style/effects.rs:819-825 | css/src/props/style/effects.rs:919-925 | css/src/props/style/effects.rs:1119-1125 | css/src/props/style/lists.rs:155-161 | css/src/props/style/lists.rs:224-230 | css/src/props/style/scrollbar.rs:954-960 | css/src/props/style/scrollbar.rs:1008-1014 | css/src/props/style/scrollbar.rs:1130-1136 | css/src/props/style/scrollbar.rs:1180-1186 | css/src/props/style/scrollbar.rs:1239-1245 | css/src/props/style/text.rs:1393-1399 | css/src/props/style/transform.rs:725-731 — there are 23 copies across 8 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 23 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 9) doc/src/codegen/v2/lang_algol68/types.rs:370— doc/src/codegen/v2/lang_algol68/types.rs:370-380 | doc/src/codegen/v2/lang_crystal/mod.rs:392-402 | doc/src/codegen/v2/lang_d/mod.rs:470-480 | doc/src/codegen/v2/lang_freebasic/types.rs:400-410 | doc/src/codegen/v2/lang_julia/mod.rs:269-279 | doc/src/codegen/v2/lang_nim/types.rs:473-483 | doc/src/codegen/v2/lang_odin/mod.rs:218-228 | doc/src/codegen/v2/lang_pascal/types.rs:548-558 | doc/src/codegen/v2/lang_v/mod.rs:243-253 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_d/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 7) doc/src/codegen/v2/lang_algol68/types.rs:384— doc/src/codegen/v2/lang_algol68/types.rs:384-391 | doc/src/codegen/v2/lang_crystal/mod.rs:405-412 | doc/src/codegen/v2/lang_d/mod.rs:482-489 | doc/src/codegen/v2/lang_julia/mod.rs:282-289 | doc/src/codegen/v2/lang_nim/types.rs:505-512 | doc/src/codegen/v2/lang_odin/mod.rs:231-238 | doc/src/codegen/v2/lang_v/mod.rs:256-263 — `doc/src/codegen/v2/lang_crystal/mod.rs` and `doc/src/codegen/v2/lang_d/mod.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 4 separate duplicated blocks between them, totalling at least 39 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 6) doc/src/codegen/v2/lang_rust.rs:603— doc/src/codegen/v2/lang_rust.rs:603-614 | doc/src/codegen/v2/lang_rust.rs:3027-3035 | doc/src/codegen/v2/lang_rust.rs:3170-3177 | doc/src/codegen/v2/lang_rust.rs:3241-3249 | doc/src/codegen/v2/lang_rust.rs:3293-3300 | doc/src/codegen/v2/lang_rust.rs:3332-3339 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 21) dll/src/desktop/shell2/linux/wayland/defines.rs:914— dll/src/desktop/shell2/linux/wayland/defines.rs:914-925 | dll/src/desktop/shell2/linux/wayland/defines.rs:1060-1071 | dll/src/desktop/shell2/linux/wayland/defines.rs:1099-1110 | dll/src/desktop/shell2/linux/wayland/defines.rs:1237-1248 | dll/src/desktop/shell2/linux/wayland/defines.rs:1351-1362 | dll/src/desktop/shell2/linux/wayland/defines.rs:1470-1481 | dll/src/desktop/shell2/linux/wayland/defines.rs:1519-1530 | dll/src/desktop/shell2/linux/wayland/defines.rs:1627-1638 | dll/src/desktop/shell2/linux/wayland/defines.rs:1960-1971 | dll/src/desktop/shell2/linux/wayland/defines.rs:2012-2023 | dll/src/desktop/shell2/linux/wayland/defines.rs:2054-2065 | dll/src/desktop/shell2/linux/wayland/defines.rs:2114-2125 | dll/src/desktop/shell2/linux/wayland/defines.rs:2186-2197 | dll/src/desktop/shell2/linux/wayland/defines.rs:2241-2252 | dll/src/desktop/shell2/linux/wayland/defines.rs:2368-2379 | dll/src/desktop/shell2/linux/wayland/defines.rs:2408-2419 | dll/src/desktop/shell2/linux/wayland/defines.rs:2555-2566 | dll/src/desktop/shell2/linux/wayland/defines.rs:2598-2609 | dll/src/desktop/shell2/linux/wayland/defines.rs:2643-2654 | dll/src/desktop/shell2/linux/wayland/defines.rs:2909-2920 | dll/src/desktop/shell2/linux/wayland/defines.rs:2994-3005 — all 21 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 13) dll/src/desktop/shell2/linux/wayland/defines.rs:775— dll/src/desktop/shell2/linux/wayland/defines.rs:775-786 | dll/src/desktop/shell2/linux/wayland/defines.rs:821-832 | dll/src/desktop/shell2/linux/wayland/defines.rs:863-874 | dll/src/desktop/shell2/linux/wayland/defines.rs:956-967 | dll/src/desktop/shell2/linux/wayland/defines.rs:1139-1150 | dll/src/desktop/shell2/linux/wayland/defines.rs:1185-1196 | dll/src/desktop/shell2/linux/wayland/defines.rs:1294-1305 | dll/src/desktop/shell2/linux/wayland/defines.rs:1664-1675 | dll/src/desktop/shell2/linux/wayland/defines.rs:2438-2449 | dll/src/desktop/shell2/linux/wayland/defines.rs:2679-2690 | dll/src/desktop/shell2/linux/wayland/defines.rs:2877-2888 | dll/src/desktop/shell2/linux/wayland/defines.rs:2946-2957 | dll/src/desktop/shell2/linux/wayland/defines.rs:3036-3047 — all 13 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (4–5 lines × 3) doc/src/reftest/debug.rs:577— doc/src/reftest/debug.rs:577-580 | doc/src/reftest/regression.rs:1701-1705 | doc/src/reftest/regression.rs:1720-1724 — 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.
End-of-life runtime: Rust 1.91 — rust-toolchain.toml declares Rust 1.91 as this project's toolchain file, and Rust 1.91, superseded by 1.92 on 2025-12-11 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-12-11 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Coverage not measured — no coverage collector is wired up — Coverage NOT MEASURED: `--collect:"XPlat Code Coverage"` names a data collector that ships in the `coverlet.collector` package, and this repository wires up none — no test project references it and no runsettings declares one. The absence of coverage here is therefore not evidence about the suite or about our analyzer environment: without a collector, `--collect` produces nothing even from a suite that builds and passes. Add a `coverlet.collector` PackageReference to the test project(s) (or commit the Cobertura/OpenCover/lcov report your CI produces) and real coverage will be measured. It is excluded from the score rather than counted as a near-zero defect.
Duplicated block (15 lines × 2 locations) REDACTED:3534— REDACTED:3534 · REDACTED:3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) REDACTED:939— REDACTED:939 · REDACTED:1037 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (13 lines × 2 locations) REDACTED:4252— REDACTED:4252 · REDACTED:4312 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (12 lines × 2 locations) REDACTED:3153— REDACTED:3153 · REDACTED:3181 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (11 lines × 2 locations) REDACTED:2842— REDACTED:2842 · REDACTED:2870 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 3 locations) REDACTED:1408— REDACTED:1408 · REDACTED:2236 · REDACTED:2993 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (9 lines × 5 locations) REDACTED:1579— REDACTED:1579 · REDACTED:2025 · REDACTED:2236 · REDACTED:2581 · +1 more site(s) not listed — all 5 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (7 lines × 2 locations) REDACTED:1697— REDACTED:1697 · REDACTED:1705 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 2 locations) REDACTED:1649— REDACTED:1649 · REDACTED:4731 — both copies are in the same file, so extract the 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 × 4 locations) REDACTED:3707— REDACTED:3707 · REDACTED:4128 · REDACTED:4201 · REDACTED:4228 — all 4 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (5 lines × 2 locations) REDACTED:2327— REDACTED:2327 · REDACTED:2378 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Complex function runStep (cyclomatic 69, cognitive 44) scripts/e2e-web/lib/driver.mjs:187— runStep has cyclomatic complexity 69 and cognitive complexity 44; 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 runAssert (cyclomatic 53, cognitive 68) scripts/e2e-web/lib/asserts.mjs:53— runAssert has cyclomatic complexity 53 and cognitive complexity 68; 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 runTest (cyclomatic 42, cognitive 79) scripts/e2e-web/run.mjs:191— runTest has cyclomatic complexity 42 and cognitive complexity 79; 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 decodePng (cyclomatic 39, cognitive 49) scripts/e2e-web/lib/png.mjs:22— decodePng has cyclomatic complexity 39 and cognitive complexity 49; 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 37, cognitive 61) · ×1
Complex function main (cyclomatic 37, cognitive 61) scripts/e2e-web/run.mjs:403— main has cyclomatic complexity 37 and cognitive complexity 61; 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 _renderTreeNode (cyclomatic 29, cognitive 34) REDACTED:656— _renderTreeNode has cyclomatic complexity 29 and cognitive complexity 34; 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 _loop (cyclomatic 27, cognitive 27) REDACTED:4572— _loop has cyclomatic complexity 27 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.
Complex function showComponentDetail (cyclomatic 26, cognitive 28) REDACTED:2265— showComponentDetail has cyclomatic complexity 26 and cognitive complexity 28; 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 render (cyclomatic 26, cognitive 9) REDACTED:3449— render has cyclomatic complexity 26 and cognitive complexity 9; 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 _parseSlashCommand (cyclomatic 23, cognitive 48) REDACTED:4753— _parseSlashCommand has cyclomatic complexity 23 and cognitive complexity 48; 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 _loadComponentPreview (cyclomatic 22, cognitive 21) REDACTED:2590— _loadComponentPreview has cyclomatic complexity 22 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 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 parseArgs (cyclomatic 22, cognitive 13) scripts/e2e-web/run.mjs:88— parseArgs has cyclomatic complexity 22 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function init (cyclomatic 21, cognitive 33) REDACTED:196— init has cyclomatic complexity 21 and cognitive complexity 33; 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 renderNodeDetail (cyclomatic 21, cognitive 24) REDACTED:795— renderNodeDetail has cyclomatic complexity 21 and cognitive complexity 24; 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 assertScreenshot (cyclomatic 21, cognitive 22) scripts/e2e-web/lib/asserts.mjs:191— assertScreenshot 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 exportCode (cyclomatic 19, cognitive 23) REDACTED:1588— exportCode has cyclomatic complexity 19 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _loadNodeClipInfo (cyclomatic 19, cognitive 21) REDACTED:1313— _loadNodeClipInfo has cyclomatic complexity 19 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.
Complex function render (cyclomatic 19, cognitive 3) REDACTED:3482— render has cyclomatic complexity 19 and cognitive complexity 3; 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 _addCollapsible (cyclomatic 18, cognitive 35) REDACTED:3335— _addCollapsible has cyclomatic complexity 18 and cognitive complexity 35; 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 runTestsInTab (cyclomatic 18, cognitive 22) scripts/e2e-web/run.mjs:333— runTestsInTab has cyclomatic complexity 18 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.
Large Files — 1 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: REDACTED (4426).
Dead file (~127 LoC) scripts/docs_pdf_book.mjs— no import path from any entry point (2 application, 1 tooling, 7 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 (~84 LoC) scripts/docs_pdf_cdp.mjs— no import path from any entry point (2 application, 1 tooling, 7 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
SC1 · Supply-chain hygiene· JavaScript dependencies are not locked · ×1
JavaScript dependencies are not locked — No package-lock.json / yarn.lock / pnpm-lock.yaml / bun.lock — JS installs aren't reproducible (SSDF PW.4.4). Commit your package manager's lockfile and install from it (`npm ci`, `yarn --immutable`, `pnpm i --frozen-lockfile` or `bun i --frozen-lockfile`). Advisory — never scored.
Duplicated predicate doc/src/codegen/v2/lang_haskell/types.rs:476— `f_len.type_name.trim() != "usize" || f_cap.type_name.trim() != "usize"` appears character-identically in 2 files — doc/src/codegen/v2/lang_haskell/types.rs, doc/src/codegen/v2/lang_ruby/wrappers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_haskell/types.rs:1132— `inner.is_empty() || inner == "c_void" || inner == "void" || inner == "()"` appears character-identically in 2 files — doc/src/codegen/v2/lang_haskell/types.rs, doc/src/codegen/v2/lang_ocaml/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_rust.rs:2450— `is_primitive_type(arg) || arg.contains("::")` appears character-identically in 2 files — doc/src/codegen/v2/lang_rust.rs, doc/src/codegen/v2/rust/shared.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_d/wrappers.rs:652— `is_union && c.name.starts_with("Result")` appears character-identically in 2 files — doc/src/codegen/v2/lang_d/wrappers.rs, doc/src/codegen/v2/lang_swift/wrappers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/autofix/discovery/parallel.rs:198— `line.starts_with("//") || line.starts_with("/*") || line.starts_with('*')` appears character-identically in 2 files — doc/src/autofix/discovery/parallel.rs, doc/src/autofix/discovery/workspace.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate dll/src/web/mod.rs:576— `lower.contains(":\\windows\\") || lower.contains(":/windows/")` appears character-identically in 2 files — dll/src/web/mod.rs, dll/src/web/symbol_table.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/reftest/autodoc.rs:272— `name.starts_with('.') || name == "target"` appears character-identically in 2 files — doc/src/reftest/autodoc.rs, doc/src/reftest/autoreview.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_nim/functions.rs:138— `ret.trim() != "void" && ret.trim() != "()"` appears character-identically in 3 files — doc/src/codegen/v2/lang_nim/functions.rs, doc/src/codegen/v2/lang_nim/types.rs, doc/src/codegen/v2/lang_nim/wrappers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_csharp/wrappers.rs:548— `s.fields[1].type_name.trim() != "usize" || s.fields[2].type_name.trim() != "usize"` appears character-identically in 3 files — doc/src/codegen/v2/lang_csharp/wrappers.rs, doc/src/codegen/v2/lang_java/wrappers.rs, doc/src/codegen/v2/lang_kotlin/wrappers.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate dll/src/desktop/extra/biometric/mod.rs:55— `std::env::var("AZ_BACKEND").as_deref() == Ok("headless") || std::env::var("AZ_E2E_TEST").is_ok()` appears character-identically in 2 files — dll/src/desktop/extra/biometric/mod.rs, dll/src/desktop/extra/keyring/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_haskell/cshim.rs:433— `t.starts_with("*const ") || t.starts_with("*mut ") || t.starts_with('&')` appears character-identically in 3 files — doc/src/codegen/v2/lang_haskell/cshim.rs, doc/src/codegen/v2/lang_haskell/wrappers.rs, doc/src/codegen/v2/lang_red/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/api.rs:1700— `trimmed.starts_with("*const ") || trimmed.starts_with("*mut ")` appears character-identically in 2 files — doc/src/api.rs, doc/src/autofix/type_index.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/c_layout.rs:85— `trimmed.starts_with("*const ") || trimmed.starts_with("*mut ") || trimmed.starts_with("&mut ") || trimmed.starts_with('&')` appears character-identically in 6 files — doc/src/codegen/v2/c_layout.rs, doc/src/codegen/v2/lang_cobol/types.rs, doc/src/codegen/v2/lang_fortran/mod.rs, doc/src/codegen/v2/lang_node/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/codegen/v2/lang_ada/mod.rs:200— `trimmed.starts_with("*mut ") || trimmed.starts_with("&mut ") || trimmed.starts_with('&')` appears character-identically in 2 files — doc/src/codegen/v2/lang_ada/mod.rs, doc/src/codegen/v2/lang_racket/mod.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate doc/src/autofix/diff.rs:490— `type_name.starts_with("Az") && type_name.len() > 2` appears character-identically in 3 files — doc/src/autofix/diff.rs, doc/src/autofix/type_index.rs, doc/src/autofix/utils.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate css/src/dynamic_selector.rs:2520— `value.eq_ignore_ascii_case("more") || value.eq_ignore_ascii_case("high") || value.eq_ignore_ascii_case("active")` appears character-identically in 2 files — css/src/dynamic_selector.rs, css/src/parser2.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate css/src/dynamic_selector.rs:2525— `value.eq_ignore_ascii_case("no-preference") || value.eq_ignore_ascii_case("none")` appears character-identically in 2 files — css/src/dynamic_selector.rs, css/src/parser2.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Subsumed condition operand dll/build_link.rs:311— `dir_str.ends_with("/debug")` can never decide this `||` — every value satisfying `dir_str.ends_with("/debug")` also satisfies `dir_str.contains("/debug")`, 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 doc/src/gene2e.rs:713— `t.starts_with("///")` can never decide this `||` — every value satisfying `t.starts_with("///")` also satisfies `t.starts_with("//")`, 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 core/src/xml.rs:461— `rel.contains("apple-touch-icon")` can never decide this `||` — every value satisfying `rel.contains("apple-touch-icon")` also satisfies `rel.contains("icon")`, 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 core/src/profile_test.rs:117— `lower.contains("memory")` can never decide this `||` — every value satisfying `lower.contains("memory")` also satisfies `lower.contains("mem")`, 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 dll/src/web/symbol_table.rs:2866— `name.contains("spec_from_iter")` can never decide this `||` — every value satisfying `name.contains("spec_from_iter")` also satisfies `name.contains("from_iter")`, 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 doc/src/codegen/v2/ir_builder.rs:871— `s.starts_with("&mut ")` can never decide this `||` — every value satisfying `s.starts_with("&mut ")` also satisfies `s.starts_with("&")`, 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 doc/src/codegen/v2/lang_lua/cdef.rs:310— `trimmed.starts_with("/* Macro to ")` can never decide this `||` — every value satisfying `trimmed.starts_with("/* Macro to ")` also satisfies `trimmed.starts_with("/* Macro ")`, 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.
Silent fallback default in catch scripts/debugging/azul-a11y-probe.py:48— `role_name` swallows every exception into `return '?'` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch scripts/debugging/azul-a11y-probe.py:70— `state_set` swallows every exception into `return ''` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Documentation: no licence statement README.md— The README links to LICENSE but no licence statement appears in the document. Place a Licence header above the badge or add a short 'License' section stating the MIT license.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P10 · Library API & versioning· Large public API surface · ×1
Large public API surface — 3967/5559 types (71%) declared in the published library are public. For a library, every public type is a stability contract — keep implementation types off the surface and expose only the intended API.
Logging is not universal — Only 4/7 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `doc/aztest`, `layout`, `webrender/swgl`.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Dependency hygiene PARTLY measured — Go module pinning and checksums read, no direct requirement to grade for currency — This repository's Go modules were read for PINNING discipline and checksum coverage: 2 requirement(s) across 1 go.mod (1 of them direct, the rest marked `// indirect`), against 1 module(s) recorded in the committed go.sum files. No pinning or checksum defect was found. That is only PART of dependency hygiene, so this dimension is NOT SCORED: whether any of these modules has a newer release, or has been deprecated by its author, is the dependency-CURRENCY question, and answering it needs the Go module proxy — and this repository has no direct Go requirement the proxy could grade. A clean pinning pass is NOT an all-clear for these dependencies, and it is not a finding that they are all USED. Known CVEs in the same module graph are a separate question again, reported under D30 wherever go.mod/go.sum is OSV-readable.
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.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a0eea4-d0e3-76ed-98e1-f5ad419a6844 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 32 · Warnings: 4919 · Recommendations: 34 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 19:29 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.